All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] common/rc: Check 'tPnE' flags on a directory instead of a regilar file
@ 2020-09-08 13:15 Xiao Yang
  2020-09-08 13:15 ` [PATCH 2/2] common/rc: Add extra check for xfs_io -c "chattr" on XFS Xiao Yang
  2020-09-13 15:34 ` [PATCH 1/2] common/rc: Check 'tPnE' flags on a directory instead of a regilar file Eryu Guan
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Yang @ 2020-09-08 13:15 UTC (permalink / raw)
  To: fstests; +Cc: darrick.wong, david, ira.weiny, linux-xfs, Xiao Yang

'tPnE' flags are only valid for a directory so check them on a directory.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index aa5a7409..cf31eebc 100644
--- a/common/rc
+++ b/common/rc
@@ -2168,8 +2168,14 @@ _require_xfs_io_command()
 		fi
 		# Test xfs_io chattr support AND
 		# filesystem FS_IOC_FSSETXATTR support
-		testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
-		$XFS_IO_PROG -F -f -r -c "chattr -$param" $testfile 2>&1
+		# 'tPnE' flags are only valid for a directory so check them on a directory.
+		if echo "$param" | egrep -q 't|P|n|E'; then
+			testio=`$XFS_IO_PROG -F -c "chattr +$param" $TEST_DIR 2>&1`
+			$XFS_IO_PROG -F -r -c "chattr -$param" $TEST_DIR 2>&1
+		else
+			testio=`$XFS_IO_PROG -F -f -c "chattr +$param" $testfile 2>&1`
+			$XFS_IO_PROG -F -r -c "chattr -$param" $testfile 2>&1
+		fi
 		param_checked="+$param"
 		;;
 	"chproj")
-- 
2.21.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-13 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 13:15 [PATCH 1/2] common/rc: Check 'tPnE' flags on a directory instead of a regilar file Xiao Yang
2020-09-08 13:15 ` [PATCH 2/2] common/rc: Add extra check for xfs_io -c "chattr" on XFS Xiao Yang
2020-09-13 15:34 ` [PATCH 1/2] common/rc: Check 'tPnE' flags on a directory instead of a regilar file Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.