Skip to contentSkip to conversation

btrfs/205: Ignore output of chattr command

PATCH In review Nikolay Borisov 2 participants 2 messages Aug 20, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs/205: Ignore output of chattr command

With newer kernels, containing upstream commit f37c563bab42 ("btrfs:
add missing check for nocow and compression inode flags") chattr would produce an error :

/usr/bin/chattr: Invalid argument while setting flags on /media/scratch/foo1

That's due to the aforementioned commit making the checks stricter. This is not critical for the purpose of the test so it can be safely ignored.

---
 tests/btrfs/205 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/btrfs/205 +1 -1
index 66355678f7d2..ab4261488ebe 100755
@@ -48,7 +48,7 @@ run_tests()
     # extent. It has a file size of 128K.
     echo "Creating file foo1"
     touch $SCRATCH_MNT/foo1
-    $CHATTR_PROG +c $SCRATCH_MNT/foo1
+    $CHATTR_PROG +c $SCRATCH_MNT/foo1 > /dev/null 2>&1
     $XFS_IO_PROG -c "pwrite -S 0xab 0 4K" \
 		 -c "fsync" \
 		 -c "pwrite -S 0xab 4K 124K" \
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Nikolay Borisov

With newer kernels, containing upstream commit f37c563bab42 ("btrfs:
add missing check for nocow and compression inode flags") chattr would produce an error :

Quoted 7 lines

/usr/bin/chattr: Invalid argument while setting flags on /media/scratch/foo1

That's due to the aforementioned commit making the checks stricter. This is not critical for the purpose of the test so it can be safely ignored.

Looks good, thanks.

Quoted 20 lines
---
 tests/btrfs/205 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/btrfs/205 +1 -2
index 66355678f7d2..ab4261488ebe 100755
@@ -48,7 +48,7 @@ run_tests()
     # extent. It has a file size of 128K.
     echo "Creating file foo1"
     touch $SCRATCH_MNT/foo1
-    $CHATTR_PROG +c $SCRATCH_MNT/foo1
+    $CHATTR_PROG +c $SCRATCH_MNT/foo1 > /dev/null 2>&1
     $XFS_IO_PROG -c "pwrite -S 0xab 0 4K" \
                 -c "fsync" \
                 -c "pwrite -S 0xab 4K 124K" \
--

2.17.1

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”