Skip to contentSkip to conversation

generic/507: support more filesystems

PATCH In review Amir Goldstein 2 participants 3 messages Jun 11, 2021 – Jun 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/507: support more filesystems

The commit message introducing the test says:
"We only check below attribute modification which most filesystem
supports:
- no atime updates (A)
- secure deletion (s)
- synchronous updates (S)
- undeletable (u)
"
But in fact, very few filesystems support the (s) and (u) flags. xfs and btrfs do not support them for example.

The test doesn't need to check those specific flags, so replace those flags with immutable (i) and append-only (a), which most filesystems really do support.

---

Eryu,

This would be a good test to cover the recent fileattr vfs changes by Miklos that changed the implementation of SETFLAGS ioctl in all the filesystem, only the test does not run on most of the filesystems...

Thanks,
Amir.

 tests/generic/507 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tests/generic/507 +6 -5
index b654883a..cc61b3cb 100755
@@ -9,7 +9,7 @@
 # i_flags can be recovered after sudden power-cuts.
 # 1. touch testfile;
 # 1.1 sync (optional)
-# 2. chattr +[AsSu] testfile
+# 2. chattr +[ASai] testfile
 # 3. xfs_io -f testfile -c "fsync";
 # 4. godown;
 # 5. umount;
@@ -34,6 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
 	cd /
+	$CHATTR_PROG -ai $testfile &> /dev/null
 	rm -f $tmp.*
 }
 
@@ -49,7 +50,7 @@ _supported_fs generic
 
 _require_command "$LSATTR_PROG" lasttr
 _require_command "$CHATTR_PROG" chattr
-_require_chattr AsSu
+_require_chattr ASai
 
 _require_scratch
 _require_scratch_shutdown
@@ -79,7 +80,7 @@ do_check()
 
 	before=`$LSATTR_PROG $testfile`
 
-	$XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+	$XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
 	_scratch_shutdown | tee -a $seqres.full
 	_scratch_cycle_mount
@@ -101,7 +102,7 @@ do_check()
 
 	before=`$LSATTR_PROG $testfile`
 
-	$XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+	$XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
 	_scratch_shutdown | tee -a $seqres.full
 	_scratch_cycle_mount
@@ -122,7 +123,7 @@ do_check()
 
 echo "Silence is golden"
 
-opts="A s S u"
+opts="A S a i"
 for i in $opts; do
 	do_check $i
 	do_check $i sync
Signature · 1 line
2.31.1
#1 lore raw
Quoted 36 lines · Amir Goldstein

The commit message introducing the test says:
"We only check below attribute modification which most filesystem
supports:
- no atime updates (A)
- secure deletion (s)
- synchronous updates (S)
- undeletable (u)
"
But in fact, very few filesystems support the (s) and (u) flags. xfs and btrfs do not support them for example.

The test doesn't need to check those specific flags, so replace those flags with immutable (i) and append-only (a), which most filesystems really do support.

---

Eryu,

This would be a good test to cover the recent fileattr vfs changes by Miklos that changed the implementation of SETFLAGS ioctl in all the filesystem, only the test does not run on most of the filesystems...

Thanks,
Amir.

 tests/generic/507 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tests/generic/507 +0 -0
index b654883a..cc61b3cb 100755

tests/generic/507 line 12

Quoted 5 lines
tests/generic/507 +1 -1
@@ -9,7 +9,7 @@
 # i_flags can be recovered after sudden power-cuts.
 # 1. touch testfile;
 # 1.1 sync (optional)
-# 2. chattr +[AsSu] testfile
+# 2. chattr +[ASai] testfile

I missed the same fix that's needed in line 8. below...

Quoted 50 lines
tests/generic/507 +5 -5
 # 3. xfs_io -f testfile -c "fsync";
 # 4. godown;
 # 5. umount;
@@ -34,6 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
        cd /
+       $CHATTR_PROG -ai $testfile &> /dev/null
        rm -f $tmp.*
 }
 
@@ -49,7 +50,7 @@ _supported_fs generic
 
 _require_command "$LSATTR_PROG" lasttr
 _require_command "$CHATTR_PROG" chattr
-_require_chattr AsSu
+_require_chattr ASai
 
 _require_scratch
 _require_scratch_shutdown
@@ -79,7 +80,7 @@ do_check()
 
        before=`$LSATTR_PROG $testfile`
 
-       $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+       $XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
        _scratch_shutdown | tee -a $seqres.full
        _scratch_cycle_mount
@@ -101,7 +102,7 @@ do_check()
 
        before=`$LSATTR_PROG $testfile`
 
-       $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+       $XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
        _scratch_shutdown | tee -a $seqres.full
        _scratch_cycle_mount
@@ -122,7 +123,7 @@ do_check()
 
 echo "Silence is golden"
 
-opts="A s S u"
+opts="A S a i"
 for i in $opts; do
        do_check $i
        do_check $i sync
--

2.31.1

#2 lore raw
Quoted 32 lines · Amir Goldstein
Quoted 31 lines · Amir Goldstein

The commit message introducing the test says:
"We only check below attribute modification which most filesystem
supports:
- no atime updates (A)
- secure deletion (s)
- synchronous updates (S)
- undeletable (u)
"
But in fact, very few filesystems support the (s) and (u) flags. xfs and btrfs do not support them for example.

The test doesn't need to check those specific flags, so replace those flags with immutable (i) and append-only (a), which most filesystems really do support.

---

Eryu,

This would be a good test to cover the recent fileattr vfs changes by Miklos that changed the implementation of SETFLAGS ioctl in all the filesystem, only the test does not run on most of the filesystems...

Thanks,
Amir.

 tests/generic/507 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Quoted 12 lines

tests/generic/507 line 12

Quoted 10 lines
tests/generic/507 +1 -1
index b654883a..cc61b3cb 100755
@@ -9,7 +9,7 @@
 # i_flags can be recovered after sudden power-cuts.
 # 1. touch testfile;
 # 1.1 sync (optional)
-# 2. chattr +[AsSu] testfile
+# 2. chattr +[ASai] testfile

I missed the same fix that's needed in line 8. below...

Fixed on commit, thanks for the heads-up!

Eryu

Quoted 51 lines
Quoted 51 lines
tests/generic/507 +5 -5
 # 3. xfs_io -f testfile -c "fsync";
 # 4. godown;
 # 5. umount;
@@ -34,6 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
        cd /
+       $CHATTR_PROG -ai $testfile &> /dev/null
        rm -f $tmp.*
 }
 
@@ -49,7 +50,7 @@ _supported_fs generic
 
 _require_command "$LSATTR_PROG" lasttr
 _require_command "$CHATTR_PROG" chattr
-_require_chattr AsSu
+_require_chattr ASai
 
 _require_scratch
 _require_scratch_shutdown
@@ -79,7 +80,7 @@ do_check()
 
        before=`$LSATTR_PROG $testfile`
 
-       $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+       $XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
        _scratch_shutdown | tee -a $seqres.full
        _scratch_cycle_mount
@@ -101,7 +102,7 @@ do_check()
 
        before=`$LSATTR_PROG $testfile`
 
-       $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
+       $XFS_IO_PROG -r -f $testfile -c "fsync" | _filter_xfs_io
 
        _scratch_shutdown | tee -a $seqres.full
        _scratch_cycle_mount
@@ -122,7 +123,7 @@ do_check()
 
 echo "Silence is golden"
 
-opts="A s S u"
+opts="A S a i"
 for i in $opts; do
        do_check $i
        do_check $i sync
--

2.31.1