Skip to content

Commit f422c66

Browse files
committed
fix: preserve directory size on read_dir failure and strengthen FUSE mount probe
When read_dir() fails, return Info with the already-computed size instead of Info::default(), which was discarding the directory's own inode size. Also tighten the FUSE mount readiness check to require Some(Ok(_)) so the probe only succeeds when a directory entry can actually be read. https://claude.ai/code/session_01LfpnUZrgq93MVZgA3KVqE6
1 parent be7c805 commit f422c66

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/fs_tree_builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ where
140140
path,
141141
error,
142142
}));
143-
return Info::default();
143+
return Info {
144+
size,
145+
children: Vec::new(),
146+
};
144147
}
145148
Ok(entries) => entries,
146149
}

tests/one_file_system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ fn cross_device_excludes_mount() {
230230
.map(Duration::from_millis)
231231
.map(sleep)
232232
.filter_map(|()| mount_point.read_dir().ok())
233-
.find_map(|mut entry| entry.next());
233+
.find_map(|mut entry| entry.next()?.ok());
234234
assert!(
235235
poll_result.is_some(),
236236
"FUSE mount at {mount_point:?} not ready after {retries} retries"

0 commit comments

Comments
 (0)