Skip to content

Commit

Permalink
Sync before fiemamp query as we know there are sync issues on some FSs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarka committed Sep 2, 2024
1 parent d712815 commit f76c45c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libfs/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,10 @@ mod tests {
let mut fd: File = File::create(&from)?;
let data = "X".repeat(size);
write!(fd, "{}", data)?;
fd.sync_all();
}

let from_fd = File::open(from)?;
let to_fd = File::create(to)?;

{
let from_map = FiemapReq::new();
assert!(fiemap(&from_fd, &from_map)?);
Expand All @@ -316,6 +315,7 @@ mod tests {
assert!(from_map.fm_extents[0].fe_flags & FIEMAP_EXTENT_SHARED == 0);
}

let to_fd = File::create(to)?;
let worked = reflink(&from_fd, &to_fd)?;
assert!(worked);

Expand Down

0 comments on commit f76c45c

Please sign in to comment.