[PR #2361] [MERGED] Improved updating of temporary stat cache while creating a file #2498

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

📋 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: masterHead: fix_update_cache


📝 Commits (1)

  • 561ca21 Improved 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_file and test_update_time_cp_p tests 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.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/2361 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 11/7/2023 **Status:** ✅ Merged **Merged:** 11/10/2023 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_update_cache` --- ### 📝 Commits (1) - [`561ca21`](https://github.com/s3fs-fuse/s3fs-fuse/commit/561ca215932fabb051f6acb4df40432d193e98b3) Improved updating of temporary stat cache while creating a file ### 📊 Changes **1 file changed** (+15 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+15 -0) </details> ### 📄 Description ### Relevant Issue (if applicable) #2332 ### Details Fixed a cause for the `test_mtime_file` and `test_update_time_cp_p` tests 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:05:51 +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#2498
No description provided.