[PR #104] [MERGED] fix rename before close #1347

Closed
opened 2026-03-04 01:53:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/104
Author: @kahing
Created: 1/12/2015
Status: Merged
Merged: 1/13/2015
Merged by: @ggtakec

Base: masterHead: rename_before_close


📝 Commits (1)

📊 Changes

8 files changed (+386 additions, -269 deletions)

View changed files

📝 src/fdcache.cpp (+13 -0)
📝 src/fdcache.h (+2 -0)
📝 src/s3fs.cpp (+3 -0)
📝 test/Makefile.am (+6 -0)
📝 test/integration-test-common.sh (+1 -1)
test/integration-test-main.sh (+292 -0)
test/rename_before_close.c (+67 -0)
📝 test/small-integration-test.sh (+2 -268)

📄 Description

nautilus does this when you drag and drop to overwrite a file:

  1. create .goutputstream-XXXXXX to write to
  2. fsync the fd for .goutputstream-XXXXXX
  3. rename .goutputstream-XXXXXX to target file
  4. close the fd for .goutputstream-XXXXXX

previously, doing this on s3fs would result in an empty target file
because after the rename, s3fs would not flush the content of
.goutputstream-XXXXXX to target file.

this change moves the FdEntity from the old path to the new path
whenever rename happens. On flush s3fs would now flush the correct
content to the rename target.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/104 **Author:** [@kahing](https://github.com/kahing) **Created:** 1/12/2015 **Status:** ✅ Merged **Merged:** 1/13/2015 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `rename_before_close` --- ### 📝 Commits (1) - [`03d84a0`](https://github.com/s3fs-fuse/s3fs-fuse/commit/03d84a07d1d8e739909f4ae89e7c7d8ef5871587) fix rename before close ### 📊 Changes **8 files changed** (+386 additions, -269 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache.cpp` (+13 -0) 📝 `src/fdcache.h` (+2 -0) 📝 `src/s3fs.cpp` (+3 -0) 📝 `test/Makefile.am` (+6 -0) 📝 `test/integration-test-common.sh` (+1 -1) ➕ `test/integration-test-main.sh` (+292 -0) ➕ `test/rename_before_close.c` (+67 -0) 📝 `test/small-integration-test.sh` (+2 -268) </details> ### 📄 Description nautilus does this when you drag and drop to overwrite a file: 1) create .goutputstream-XXXXXX to write to 2) fsync the fd for .goutputstream-XXXXXX 3) rename .goutputstream-XXXXXX to target file 4) close the fd for .goutputstream-XXXXXX previously, doing this on s3fs would result in an empty target file because after the rename, s3fs would not flush the content of .goutputstream-XXXXXX to target file. this change moves the FdEntity from the old path to the new path whenever rename happens. On flush s3fs would now flush the correct content to the rename target. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:53:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1347
No description provided.