mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-19 16:16:48 +00:00
Clarify releasedir readdir synchronization barrier
- Document the lock/unlock pair as an acquire/release barrier. - Explain that releasedir waits for in-flight readdir calls before destroy/free. - Warn against removing the synchronization despite it not being a critical section.
This commit is contained in:
committed by
trapexit
parent
1e0bd54989
commit
8608b2be46
@@ -2543,7 +2543,11 @@ fuse_lib_releasedir(fuse_req_t *req_,
|
||||
f.ops.releasedir(&req_->ctx,
|
||||
&ffi);
|
||||
|
||||
/* Done to keep race condition between last readdir reply and the unlock */
|
||||
// Acquire/release barrier: not a real critical section. A
|
||||
// concurrent readdir may still hold dh->lock at this point. This
|
||||
// lock+unlock pair blocks until the last readdir drops the lock
|
||||
// guaranteeing that the subsequent destroy/free sees no in-flight
|
||||
// readdir accessing dh->d. Do NOT remove.
|
||||
mutex_lock(dh->lock);
|
||||
mutex_unlock(dh->lock);
|
||||
mutex_destroy(dh->lock);
|
||||
|
||||
Reference in New Issue
Block a user