Skip to content

Commit 754765c

Browse files
committed
fix(sync): release mount coordinator lock explicitly
1 parent 50524f2 commit 754765c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/localityd/src/generation_mount.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ pub(crate) struct SecureTarget {
3737
name: OsString,
3838
}
3939

40+
#[cfg(unix)]
41+
impl Drop for SecureMount {
42+
fn drop(&mut self) {
43+
// Targets use dup'd root descriptors. Release coordinator ownership
44+
// when the mount guard ends instead of waiting for every duplicate.
45+
let _ = rustix::fs::flock(&self.root, rustix::fs::FlockOperation::Unlock);
46+
}
47+
}
48+
4049
impl SecureMount {
4150
pub(crate) fn open(root: &Path) -> io::Result<Self> {
4251
#[cfg(unix)]

0 commit comments

Comments
 (0)