Re: [PATCH] btrfs/321: make the test work when compression is enabled

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 12/9/24 8:45 pm, fdmanana@xxxxxxxxxx wrote:
From: Filipe Manana <fdmanana@xxxxxxxx>

When running btrfs/321 with compression enabled it fails like this:

   $ MOUNT_OPTIONS="-o compress" ./check btrfs/321
   FSTYP         -- btrfs
   PLATFORM      -- Linux/x86_64 debian0 6.11.0-rc7-btrfs-next-174+ #1 SMP PREEMPT_DYNAMIC Tue Sep 10 17:11:38 WEST 2024
   MKFS_OPTIONS  -- /dev/sdc
   MOUNT_OPTIONS -- -o compress /dev/sdc /home/fdmanana/btrfs-tests/scratch_1

   btrfs/321 2s ... [failed, exit status 1]- output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/321.out.bad)
       --- tests/btrfs/321.out	2024-09-12 12:12:11.259272125 +0100
       +++ /home/fdmanana/git/hub/xfstests/results//btrfs/321.out.bad	2024-09-12 13:18:40.231120012 +0100
       @@ -1,2 +1,5 @@
        QA output created by 321
       -Silence is golden
       +mount: /home/fdmanana/btrfs-tests/scratch_1: can't read superblock on /dev/sdc.
       +       dmesg(1) may have more information after failed mount system call.
       +mount -o compress -o ro /dev/sdc /home/fdmanana/btrfs-tests/scratch_1 failed
       +(see /home/fdmanana/git/hub/xfstests/results//btrfs/321.full for details)
       ...
       (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/321.out /home/fdmanana/git/hub/xfstests/results//btrfs/321.out.bad'  to see the entire diff)

   HINT: You _MAY_ be missing kernel fix:
         10d9d8c3512f btrfs: fix a use-after-free bug when hitting errors inside btrfs_submit_chunk()

   Ran: btrfs/321
   Failures: btrfs/321
   Failed 1 of 1 tests

This is because with compression enabled we get a csum tree that has only
one leaf, and that leaf is the root of the csum tree. That means that
after the test corrupts the leaf, the next mount will fail since an error
loading the root is critical and makes the mount operation fail.

Fix this by creating a file with 128M of data instead of 32M, as this
guarantees that even if compression is enabled, and even with the maximum
allowed leaf size (64K), we still get a csum tree with multiple leaves,
making the test work.

Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>


looks good.

Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>









[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux