Skip to content

Commit

Permalink
fallocate05: Deallocate whole file on bcachefs
Browse files Browse the repository at this point in the history
The default deallocation size is likely too small for bcachefs
to actually release the blocks. Since it is also a copy-on-write
filesystem, deallocated the whole file like on Btrfs.

Signed-off-by: Martin Doucha <[email protected]>
Reviewed-by: Li Wang <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
  • Loading branch information
mdoucha authored and wangli5665 committed Sep 10, 2024
1 parent 2c565b4 commit cc9730e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testcases/kernel/syscalls/fallocate/fallocate05.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ static void run(void)
tst_res(TPASS, "fallocate() on full FS");

/* Btrfs deallocates only complete extents, not individual blocks */
if (!strcmp(tst_device->fs_type, "btrfs"))
if (!strcmp(tst_device->fs_type, "btrfs") ||
!strcmp(tst_device->fs_type, "bcachefs"))
holesize = bufsize + extsize;
else
holesize = DEALLOCATE_BLOCKS * blocksize;
Expand Down

0 comments on commit cc9730e

Please sign in to comment.