[PR #1063] [MERGED] Flush file when opening second fd #1784

Closed
opened 2026-03-04 02:02:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1063
Author: @gaul
Created: 7/2/2019
Status: Merged
Merged: 7/3/2019
Merged by: @ggtakec

Base: masterHead: truncate-2nd-open-fd


📝 Commits (1)

  • c596441 Flush file when opening second fd

📊 Changes

4 files changed (+24 additions, -8 deletions)

View changed files

📝 src/cache.cpp (+1 -1)
📝 src/cache.h (+6 -6)
📝 src/s3fs.cpp (+7 -1)
📝 test/integration-test-main.sh (+10 -0)

📄 Description

Previously when s3fs had dirty local data and an application opened a
second fd it would remove the stat cache entry, query S3 for the size
which was still zero, then reinitialize FdEntry with this incorrect
size. Instead flush local data to S3 so this query works. It is
possible that a more involved patch could do this with a less
heavyweight approach but this requires changing open. This does not
completely fix git clone but allows it to proceed further. Also make
some cache methods const-correct. References #839.


🔄 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/1063 **Author:** [@gaul](https://github.com/gaul) **Created:** 7/2/2019 **Status:** ✅ Merged **Merged:** 7/3/2019 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `truncate-2nd-open-fd` --- ### 📝 Commits (1) - [`c596441`](https://github.com/s3fs-fuse/s3fs-fuse/commit/c596441f5872c5309908739de66397182229123c) Flush file when opening second fd ### 📊 Changes **4 files changed** (+24 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/cache.cpp` (+1 -1) 📝 `src/cache.h` (+6 -6) 📝 `src/s3fs.cpp` (+7 -1) 📝 `test/integration-test-main.sh` (+10 -0) </details> ### 📄 Description Previously when s3fs had dirty local data and an application opened a second fd it would remove the stat cache entry, query S3 for the size which was still zero, then reinitialize `FdEntry` with this incorrect size. Instead flush local data to S3 so this query works. It is possible that a more involved patch could do this with a less heavyweight approach but this requires changing open. This does not completely fix `git clone` but allows it to proceed further. Also make some cache methods `const`-correct. References #839. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:02:09 +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#1784
No description provided.