[PR #321] [MERGED] 320: delete stat cache entry in s3fs_fsync so st_size is refreshed #1460

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/321
Author: @mcellis33
Created: 12/18/2015
Status: Merged
Merged: 12/20/2015
Merged by: @ggtakec

Base: masterHead: 320


📝 Commits (1)

  • 163daa5 320: delete stat cache entry in s3fs_fsync so st_size is refreshed

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 src/s3fs.cpp (+3 -0)

📄 Description

@ggtakec

My proposed solution to #320 is for s3fs_fsync to delete the stat cache entry. Then, any subsequent operations will need to refresh the stat cache with a HEAD request. This will negatively impact performance in that it will cause more round trips. However, this is the simplest way to make s3fs_fsync correct. Someone who understands more about how the stat cache works could try to surgically update the stat cache to reflect the new file size in s3fs_fsync.

With this change, the test program from the #320 description outputs

/vagrant/testmount/testfile
stat size 12

🔄 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/321 **Author:** [@mcellis33](https://github.com/mcellis33) **Created:** 12/18/2015 **Status:** ✅ Merged **Merged:** 12/20/2015 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `320` --- ### 📝 Commits (1) - [`163daa5`](https://github.com/s3fs-fuse/s3fs-fuse/commit/163daa5de11206a76e1895be3f030158375e154d) 320: delete stat cache entry in s3fs_fsync so st_size is refreshed ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+3 -0) </details> ### 📄 Description @ggtakec My proposed solution to #320 is for `s3fs_fsync` to delete the stat cache entry. Then, any subsequent operations will need to refresh the stat cache with a HEAD request. This will negatively impact performance in that it will cause more round trips. However, this is the simplest way to make `s3fs_fsync` correct. Someone who understands more about how the stat cache works could try to surgically update the stat cache to reflect the new file size in `s3fs_fsync`. With this change, the test program from the #320 description outputs ``` /vagrant/testmount/testfile stat size 12 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:54:04 +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#1460
No description provided.