Skip to contentSkip to conversation

btrfs/024: Remove no longer valid test

PATCH Superseded Nikolay Borisov 4 participants 11 messages Aug 17, 2020 – Aug 30, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 btrfs/024: Remove no longer valid test

Kernel commit "btrfs: add missing check for nocow and compression inode flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test.

---
 tests/btrfs/024 | 7 -------
 1 file changed, 7 deletions(-)
tests/btrfs/024 +0 -7
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io
 }
 
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 btrfs/173: Adjust compress file check

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.

---
 tests/btrfs/173     | 4 +---
 tests/btrfs/173.out | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
tests/btrfs/173 +1 -3
index 515d8cfa0994..c427320ad664 100755
@@ -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
tests/btrfs/173.out +1 -1
index 6d7856bf9e02..2920384045ad 100644
@@ -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
Signature · 1 line
2.17.1
Reviewed-by on v1 2/3
#2 lore raw

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

Quoted 2 lines · Nikolay Borisov

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.

Quoted 38 lines

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.

---
  tests/btrfs/173     | 4 +---
  tests/btrfs/173.out | 2 +-
  2 files changed, 2 insertions(+), 4 deletions(-)
tests/btrfs/173 +1 -3
index 515d8cfa0994..c427320ad664 100755
@@ -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

tests/btrfs/173.out +1 -1
index 6d7856bf9e02..2920384045ad 100644
@@ -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
#3 lore raw

PATCH 3/3 btrfs/174: Adjust error message when setting compressed flag

In reply to Nikolay Borisov

Following kernel commit "btrfs: add missing check for nocow and compression inode flags" btrfs refuses setting +c on +C files during validation of the args. Account for this by adjusting the expected error message.

---
 tests/btrfs/174     | 2 +-
 tests/btrfs/174.out | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/btrfs/174 +1 -1
index af3352212170..bca1dc5c0b3b 100755
@@ -47,7 +47,7 @@ $LSATTR_PROG -l "$swapfile" | _filter_scratch | _filter_spaces
 
 # Compression we reject outright.
 echo "Enable compression"
-$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Text file busy"
+$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Invalid argument while setting flags"
 $LSATTR_PROG -l "$swapfile" | _filter_scratch | _filter_spaces
 
 echo "Snapshot"
tests/btrfs/174.out +1 -1
index bc24f1fb8be3..15bdf79e7bfb 100644
@@ -2,7 +2,7 @@ QA output created by 174
 Disable nocow
 SCRATCH_MNT/swapvol/swap No_COW
 Enable compression
-Text file busy
+Invalid argument while setting flags
 SCRATCH_MNT/swapvol/swap No_COW
 Snapshot
 Text file busy
Signature · 1 line
2.17.1
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] btrfs/174: Adjust error message when setting compressed flag

Quoted 2 lines · Nikolay Borisov

Following kernel commit "btrfs: add missing check for nocow and compression inode flags"

Here too, can you pls add this to the test case header.

Otherwise looks good.

Quoted 36 lines

btrfs refuses setting +c on +C files during
validation of the args. Account for this by adjusting the expected error message.

Quoted 1 line
---
  tests/btrfs/174     | 2 +-
  tests/btrfs/174.out | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
tests/btrfs/174 +1 -1
index af3352212170..bca1dc5c0b3b 100755
@@ -47,7 +47,7 @@ $LSATTR_PROG -l "$swapfile" | _filter_scratch | _filter_spaces
 
  # Compression we reject outright.
  echo "Enable compression"
-$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Text file busy"
+$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Invalid argument while setting flags"
  $LSATTR_PROG -l "$swapfile" | _filter_scratch | _filter_spaces
 
  echo "Snapshot"
tests/btrfs/174.out +1 -1
index bc24f1fb8be3..15bdf79e7bfb 100644
@@ -2,7 +2,7 @@ QA output created by 174
  Disable nocow
  SCRATCH_MNT/swapvol/swap No_COW
  Enable compression
-Text file busy
+Invalid argument while setting flags
  SCRATCH_MNT/swapvol/swap No_COW
  Snapshot
  Text file busy
Reviewed-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] btrfs/174: Adjust error message when setting compressed flag

In reply to Nikolay Borisov
Quoted 4 lines · Nikolay Borisov

Following kernel commit "btrfs: add missing check for nocow and compression inode flags" btrfs refuses setting +c on +C files during validation of the args. Account for this by adjusting the expected error message.

LGTM, so

Quoted 35 lines
---
 tests/btrfs/174     | 2 +-
 tests/btrfs/174.out | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tests/btrfs/174 +0 -0
index af3352212170..bca1dc5c0b3b 100755
@@ -47,7 +47,7 @@ $LSATTR_PROG -l "$swapfile" | _filter_scratch |

_filter_spaces

# Compression we reject outright.
echo "Enable compression"
-$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Text file busy" +$CHATTR_PROG +c "$swapfile" 2>&1 | grep -o "Invalid argument while setting flags"
$LSATTR_PROG -l "$swapfile" | _filter_scratch | _filter_spaces

echo "Snapshot"

tests/btrfs/174.out +1 -1
index bc24f1fb8be3..15bdf79e7bfb 100644
@@ -2,7 +2,7 @@ QA output created by 174
 Disable nocow
 SCRATCH_MNT/swapvol/swap No_COW
 Enable compression
-Text file busy
+Invalid argument while setting flags
 SCRATCH_MNT/swapvol/swap No_COW
 Snapshot
 Text file busy
#6 lore raw
In reply to Nikolay Borisov
Quoted 5 lines · Nikolay Borisov

Kernel commit "btrfs: add missing check for nocow and compression inode flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test.

This patch is missing the removal of the respective output from 024.out. I'll be sending a fixed up version later.

Quoted 23 lines
---
 tests/btrfs/024 | 7 -------
 1 file changed, 7 deletions(-)
tests/btrfs/024 +0 -7
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io
 }
 
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
#7 lore raw

PATCH v2 1/1 btrfs/024: Remove no longer valid test

In reply to Nikolay Borisov

Kernel commit "btrfs: add missing check for nocow and compression inode flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test.

---
V2:
* Also remove the output

 tests/btrfs/024     | 7 -------
 tests/btrfs/024.out | 3 ---
 2 files changed, 10 deletions(-)
tests/btrfs/024 +0 -7
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io
 }
 
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
tests/btrfs/024.out +0 -3
index 7eacb0aca674..33c4f49366fd 100644
@@ -1,7 +1,4 @@
 QA output created by 024
-*** test nodatacow
-wrote 1048576/1048576 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** test compress=no
 wrote 1048576/1048576 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

--
2.17.1

Reviewed-by on v2 1/1
#8 lore raw
Quoted 5 lines · Nikolay Borisov

Kernel commit "btrfs: add missing check for nocow and compression inode
flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test

LGTM, so:

Quoted 45 lines

.

---
V2:
* Also remove the output

 tests/btrfs/024     | 7 -------
 tests/btrfs/024.out | 3 ---
 2 files changed, 10 deletions(-)
tests/btrfs/024 +0 -0
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file |

_filter_xfs_io
}

tests/btrfs/024 +0 -7
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
tests/btrfs/024.out +0 -4
index 7eacb0aca674..33c4f49366fd 100644
@@ -1,7 +1,4 @@
 QA output created by 024
-*** test nodatacow
-wrote 1048576/1048576 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** test compress=no
 wrote 1048576/1048576 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
--

2.17.1

#9 lore raw
In reply to Nikolay Borisov

Hi Nikolay,

Quoted 5 lines · Nikolay Borisov

Kernel commit "btrfs: add missing check for nocow and compression inode flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test.

I applied this patch, but left patch 2 and 3, as Anand suggested minor updates, and I assume you'll send new version of patch 2 and 3 :)

Thanks,
Eryu

Quoted 40 lines

---
V2:
* Also remove the output

 tests/btrfs/024     | 7 -------
 tests/btrfs/024.out | 3 ---
 2 files changed, 10 deletions(-)
tests/btrfs/024 +0 -7
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io
 }
 
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
tests/btrfs/024.out +0 -4
index 7eacb0aca674..33c4f49366fd 100644
@@ -1,7 +1,4 @@
 QA output created by 024
-*** test nodatacow
-wrote 1048576/1048576 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** test compress=no
 wrote 1048576/1048576 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
--

2.17.1

#10 lore raw
Quoted 11 lines · Eryu Guan

Hi Nikolay,

Quoted 5 lines · Nikolay Borisov

Kernel commit "btrfs: add missing check for nocow and compression inode flags" invalidates the "file compressed, fs mounted with nodatacow" mode due to doing more rigorous flags validation, just remove the test.

I applied this patch, but left patch 2 and 3, as Anand suggested minor updates, and I assume you'll send new version of patch 2 and 3 :)

Please merge the patches as is, I don't intend on sending v2.

Quoted 45 lines

Thanks,
Eryu

Quoted 40 lines

---
V2:
* Also remove the output

 tests/btrfs/024     | 7 -------
 tests/btrfs/024.out | 3 ---
 2 files changed, 10 deletions(-)
tests/btrfs/024 +0 -7
index 0c2ffd7389ab..bcb9048da636 100755
@@ -42,13 +42,6 @@ __workout()
 	$XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $work_file | _filter_xfs_io
 }
 
-echo "*** test nodatacow"
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount "-o nodatacow"
-__workout
-_scratch_unmount
-_check_scratch_fs
-
 echo "*** test compress=no"
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount "-o compress=no"
tests/btrfs/024.out +0 -4
index 7eacb0aca674..33c4f49366fd 100644
@@ -1,7 +1,4 @@
 QA output created by 024
-*** test nodatacow
-wrote 1048576/1048576 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** test compress=no
 wrote 1048576/1048576 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
--

2.17.1