Skip to content

Commit 1e6c221

Browse files
committed
fix(deps): Adapt code to fuser 0.17 breaking changes
fuser 0.17 requires Filesystem: Send + Sync + 'static, which means the composefs core types need to be thread-safe. This commit: - Changes Rc<Leaf<T>> to Arc<Leaf<T>> and Box<Directory<T>> to Arc<Directory<T>> in the generic_tree Inode enum, making tree nodes shareable across threads. - Changes RefCell<BTreeMap<...>> to RwLock<BTreeMap<...>> in Stat.xattrs, replacing .borrow()/.borrow_mut() with .read().unwrap()/.write().unwrap(). - Rewrites composefs-fuse to adapt to fuser 0.17's API changes: - &mut self -> &self on all Filesystem trait methods (mutable state moved behind a Mutex) - u64 -> INodeNo/FileHandle/LockOwner newtype wrappers - i32 -> OpenFlags, reply errors use fuser::Errno constants - Session::run() replaced with Session::spawn()?.join() - Session::from_fd() takes a Config parameter - serve_tree_fuse() now takes Arc<Directory> and Arc<Repository> by value to satisfy the 'static bound - #![forbid(unsafe_code)] is preserved throughout Assisted-by: OpenCode (claude-opus-4-6)
1 parent a154cfc commit 1e6c221

15 files changed

Lines changed: 653 additions & 315 deletions

File tree

crates/composefs-boot/src/selabel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl Policy {
211211
}
212212

213213
fn relabel(stat: &Stat, path: &Path, ifmt: u8, policy: &mut Policy) {
214-
let mut xattrs = stat.xattrs.borrow_mut();
214+
let mut xattrs = stat.xattrs.write().unwrap();
215215
let key = OsStr::new(XATTR_SECURITY_SELINUX);
216216

217217
if let Some(label) = policy.lookup(path.as_os_str(), ifmt) {
@@ -268,7 +268,8 @@ fn parse_config(file: impl Read) -> Result<Option<String>> {
268268
fn strip_selinux_labels<H: FsVerityHashValue>(fs: &FileSystem<H>) {
269269
fs.for_each_stat(|stat| {
270270
stat.xattrs
271-
.borrow_mut()
271+
.write()
272+
.unwrap()
272273
.remove(OsStr::new(XATTR_SECURITY_SELINUX));
273274
});
274275
}

0 commit comments

Comments
 (0)