mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[PR #2361] [MERGED] Improved updating of temporary stat cache while creating a file #2498
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#2498
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2361
Author: @ggtakec
Created: 11/7/2023
Status: ✅ Merged
Merged: 11/10/2023
Merged by: @gaul
Base:
master← Head:fix_update_cache📝 Commits (1)
561ca21Improved updating of temporary stat cache while creating a file📊 Changes
1 file changed (+15 additions, -0 deletions)
View changed files
📝
src/s3fs.cpp(+15 -0)📄 Description
Relevant Issue (if applicable)
#2332
Details
Fixed a cause for the
test_mtime_fileandtest_update_time_cp_ptests to fail on Alpine 3.18.The problem is that the stat information is read before updating a/c/mtime due to a change in the calling order (timing) of the fuse handler when creating a new file.
First, some background:
In previous versions of current s3fs, the process of creating a new file would first create an empty file.
In the current version, this unnecessary process has been simplified and the file is created for the first time when the file content is uploaded.
This simplification causes problems when file stat information is read between the time a new file is created and the time the file is uploaded.
To avoid this, the stat information is retained as a cache even though the file does not yet exist(before uploading).
In Alpine 3.18, when this file does not yet exist, a call to utimens updates the file's timestamp and immediately reads the Stat information.
In the current s3fs, the stat information read at this time is cached stat information at creating a file, and is a timestamp whose utimens have not been updated.
In Alpine3.17(and other OS), the stat information was not read at this timing.
Therefore, when the timestamp is updated in utimens, if there is temporary Stat cache information, we solved this problem by updating that cache information.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.