diff mbox series

[2/3] btrfs/173: Adjust compress file check

Message ID 20200817103718.10239-2-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series [1/3] btrfs/024: Remove no longer valid test | expand

Commit Message

Nikolay Borisov Aug. 17, 2020, 10:37 a.m. UTC
Following kernel commit "btrfs: add missing check for nocow and
compression inode flags" the enforcement of "can't set +c on a +C" file
has been moved to the ioctl code. Modify the test to account for this.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 tests/btrfs/173     | 4 +---
 tests/btrfs/173.out | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Anand Jain Aug. 17, 2020, 10:47 a.m. UTC | #1
On 17/8/20 6:37 pm, Nikolay Borisov wrote:
> Following kernel commit "btrfs: add missing check for nocow and
> compression inode flags" 

  Can you add this to the test case header.

  Otherwise looks good.

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



> the enforcement of "can't set +c on a +C" file
> has been moved to the ioctl code. Modify the test to account for this.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>   tests/btrfs/173     | 4 +---
>   tests/btrfs/173.out | 2 +-
>   2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/btrfs/173 b/tests/btrfs/173
> index 515d8cfa0994..c427320ad664 100755
> --- a/tests/btrfs/173
> +++ b/tests/btrfs/173
> @@ -48,9 +48,7 @@ swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
>   echo "Compressed file"
>   rm -f "$SCRATCH_MNT/swap"
>   _format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10))
> -$CHATTR_PROG +c "$SCRATCH_MNT/swap"
> -swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
> -swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
> +$CHATTR_PROG +c "$SCRATCH_MNT/swap" 2>&1 | grep -o "Invalid argument while setting flags"



>   
>   status=0
>   exit
> diff --git a/tests/btrfs/173.out b/tests/btrfs/173.out
> index 6d7856bf9e02..2920384045ad 100644
> --- a/tests/btrfs/173.out
> +++ b/tests/btrfs/173.out
> @@ -2,4 +2,4 @@ QA output created by 173
>   COW file
>   swapon: SCRATCH_MNT/swap: swapon failed: Invalid argument
>   Compressed file
> -swapon: SCRATCH_MNT/swap: swapon failed: Invalid argument
> +Invalid argument while setting flags
>
diff mbox series

Patch

diff --git a/tests/btrfs/173 b/tests/btrfs/173
index 515d8cfa0994..c427320ad664 100755
--- a/tests/btrfs/173
+++ b/tests/btrfs/173
@@ -48,9 +48,7 @@  swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
 echo "Compressed file"
 rm -f "$SCRATCH_MNT/swap"
 _format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10))
-$CHATTR_PROG +c "$SCRATCH_MNT/swap"
-swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
-swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
+$CHATTR_PROG +c "$SCRATCH_MNT/swap" 2>&1 | grep -o "Invalid argument while setting flags"
 
 status=0
 exit
diff --git a/tests/btrfs/173.out b/tests/btrfs/173.out
index 6d7856bf9e02..2920384045ad 100644
--- a/tests/btrfs/173.out
+++ b/tests/btrfs/173.out
@@ -2,4 +2,4 @@  QA output created by 173
 COW file
 swapon: SCRATCH_MNT/swap: swapon failed: Invalid argument
 Compressed file
-swapon: SCRATCH_MNT/swap: swapon failed: Invalid argument
+Invalid argument while setting flags