[PR #2404] [MERGED] Fixed a bug in fdatasync(fsync) #2523

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2404
Author: @ggtakec
Created: 1/27/2024
Status: Merged
Merged: 2/6/2024
Merged by: @gaul

Base: masterHead: fix_fdatasync


📝 Commits (1)

  • 5942adf Fixed a bug in fdatasync(fsync)

📊 Changes

4 files changed (+55 additions, -22 deletions)

View changed files

📝 src/fdcache_entity.cpp (+39 -4)
📝 src/fdcache_entity.h (+3 -0)
📝 src/s3fs.cpp (+11 -1)
📝 test/integration-test-main.sh (+2 -17)

📄 Description

Relevant Issue (if applicable)

#2376
#2198

Details

After merging #2376, test_update_time_append started to fail in the case of macos fuse-t, so it was fixed.

The test failure is due to a different calling sequence from FUSE in using macos fuse-t.
In the case of macos fuse-t, s3fs_fsync(a case of datasync) is called before calling s3fs_flush when closing a file after updating or creating.
In other words, a calling sequence is open(create)->write->fdatasync->flush->release.
Until now, there were no cases where s3fs_fsync was called, causing problems with updating file metadata.

Fixed so that when s3fs_fsync(datasync) is called, the file content is not updated at flush, but only metadata can be updated.

With this fix, most of required sleep in test for macos, such as #2198, are no longer necessary.
As @gaul feared, the test that required these sleeps was probably caused by an issue on the s3fs side.
In this PR, unnecessary sleep has been removed.


🔄 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/2404 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 1/27/2024 **Status:** ✅ Merged **Merged:** 2/6/2024 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_fdatasync` --- ### 📝 Commits (1) - [`5942adf`](https://github.com/s3fs-fuse/s3fs-fuse/commit/5942adf5f223489383b67c5373f1d5c5aea66e84) Fixed a bug in fdatasync(fsync) ### 📊 Changes **4 files changed** (+55 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache_entity.cpp` (+39 -4) 📝 `src/fdcache_entity.h` (+3 -0) 📝 `src/s3fs.cpp` (+11 -1) 📝 `test/integration-test-main.sh` (+2 -17) </details> ### 📄 Description ### Relevant Issue (if applicable) #2376 #2198 ### Details After merging #2376, `test_update_time_append` started to fail in the case of `macos fuse-t`, so it was fixed. The test failure is due to a different calling sequence from FUSE in using `macos fuse-t`. In the case of `macos fuse-t`, `s3fs_fsync`(a case of `datasync`) is called before calling `s3fs_flush` when closing a file after updating or creating. In other words, a calling sequence is `open(create)`->`write`->`fdatasync`->`flush`->`release`. Until now, there were no cases where `s3fs_fsync` was called, causing problems with updating file metadata. Fixed so that when `s3fs_fsync`(`datasync`) is called, the file content is not updated at `flush`, but only metadata can be updated. With this fix, most of required `sleep` in test for macos, such as #2198, are no longer necessary. As @gaul feared, the test that required these `sleep`s was probably caused by an issue on the s3fs side. In this PR, unnecessary `sleep` has been removed. --- <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:59 +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#2523
No description provided.