[PR #2214] [MERGED] Fixed data race about fuse_fill_dir_t function and data pointer #2393

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2214
Author: @ggtakec
Created: 7/13/2023
Status: Merged
Merged: 7/14/2023
Merged by: @gaul

Base: masterHead: fix_filler_datarace


📝 Commits (1)

  • 918cb78 Fixed data race about fuse_fill_dir_t function and data pointer

📊 Changes

1 file changed (+92 additions, -35 deletions)

View changed files

📝 src/s3fs.cpp (+92 -35)

📄 Description

Relevant Issue (if applicable)

#2213 #2212

Details

In the thread callback handler for HeadRequest called by FUSE readdir, void* buf and fuse_fill_dir_t filler seem not suitable for asynchronous writes.
I checked the FUSE source code, but it seems that exclusive control for buf is not implemented by filler.

s3fs HeadRequests are processed in parallel by multithreading, so it seems that this filler call needs to be synchronized.
However, ThreadSanitizer never detected this part yet.
(Even if exclusive control is performed in the filler, I have decided that exclusive control on the s3fs side is not a particular problem, so I am submitting this PR.)

This fix obsoletes multi_head_callback_param uses in threading functions and uses SyncFiller objects instead.
All data related to filler and buf are implemented inside the SyncFiller object.
(This includes filled variables added by #2212)
SyncFiller object handles buf/filler/filled safely.


🔄 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/2214 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 7/13/2023 **Status:** ✅ Merged **Merged:** 7/14/2023 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_filler_datarace` --- ### 📝 Commits (1) - [`918cb78`](https://github.com/s3fs-fuse/s3fs-fuse/commit/918cb78ee71ee33e36765b8924917ce45606d4ed) Fixed data race about fuse_fill_dir_t function and data pointer ### 📊 Changes **1 file changed** (+92 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+92 -35) </details> ### 📄 Description ### Relevant Issue (if applicable) #2213 #2212 ### Details In the thread callback handler for `HeadRequest` called by FUSE readdir, `void* buf` and `fuse_fill_dir_t filler` seem not suitable for asynchronous writes. I checked the FUSE source code, but it seems that exclusive control for `buf` is not implemented by `filler`. s3fs `HeadRequests` are processed in parallel by multithreading, so it seems that this `filler` call needs to be synchronized. _However, `ThreadSanitizer` never detected this part yet._ (Even if exclusive control is performed in the `filler`, I have decided that exclusive control on the s3fs side is not a particular problem, so I am submitting this PR.) This fix obsoletes `multi_head_callback_param` uses in threading functions and uses `SyncFiller` objects instead. All data related to `filler` and `buf` are implemented inside the `SyncFiller` object. _(This includes `filled` variables added by #2212)_ `SyncFiller` object handles `buf`/`filler`/`filled` safely. --- <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:18 +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#2393
No description provided.