generic/554: hide permision warning on exfat
authorPavel Reichl <preichl@redhat.com>
Thu, 15 Apr 2021 09:49:04 +0000 (11:49 +0200)
committerEryu Guan <guaneryu@gmail.com>
Sun, 18 Apr 2021 12:53:53 +0000 (20:53 +0800)
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/554

index e5a65f25091b52e333fd28ffff7e952da969a385..11ff7635700bd3b740c3efc3b565d059feeb3f6b 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2425,6 +2425,13 @@ _format_swapfile() {
        $MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2) >> $seqres.full
 }
 
+_swapon_file() {
+       local fname="$1"
+
+       # Ignore permission complaints on filesystems that don't support perms
+       swapon "$fname" 2> >(grep -v "insecure permissions" >&2)
+}
+
 # Check that the filesystem supports swapfiles
 _require_scratch_swapfile()
 {
index fa4f97d25d5ba237e52d14eacd07efc75ba3d8af..da9bfce5bd289a4394637ee0ab61dcf31506cf55 100755 (executable)
@@ -46,7 +46,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&
 
 echo swap files return ETXTBUSY
 _format_swapfile $SCRATCH_MNT/swapfile 16m
-swapon $SCRATCH_MNT/swapfile
+_swapon_file $SCRATCH_MNT/swapfile
+
 $XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
 swapoff $SCRATCH_MNT/swapfile