All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/449: make the test effective against xfs
@ 2017-08-01  4:55 Ernesto A. Fernández
  2017-08-02  1:33 ` Eryu Guan
  2017-08-02  4:19 ` [PATCH v2] " Ernesto A. Fernández
  0 siblings, 2 replies; 8+ messages in thread
From: Ernesto A. Fernández @ 2017-08-01  4:55 UTC (permalink / raw)
  To: fstests; +Cc: Ernesto A. Fernández

Setting acls on an xfs filesystem will succeed even after running out
of space for user attributes. Use trusted attributes instead.

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
---
 tests/generic/449 | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tests/generic/449 b/tests/generic/449
index fb776b3..6fbc634 100755
--- a/tests/generic/449
+++ b/tests/generic/449
@@ -59,6 +59,15 @@ _require_attrs
 _scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1
 _scratch_mount || _fail "mount failed"
 
+if [ "$FSTYP" == "xfs" ]; then
+	# xfs takes too long to run out of space if setting only the names
+	# of the attributes. Create a 5k file filled with dots to be used
+	# as their value.
+	VFILE=$SCRATCH_MNT/valuefile
+	touch $VFILE
+	$XFS_IO_PROG -c "pwrite -S 0x2E 0 5k" $VFILE >>$seqres.full 2>&1
+fi
+
 TFILE=$SCRATCH_MNT/testfile.$seq
 
 # Create the test file and choose its permissions
@@ -70,6 +79,13 @@ chmod go-rwx $TFILE
 $XFS_IO_PROG -c "pwrite 0 50m" $TFILE >>$seqres.full 2>&1
 i=1
 j=1
+ATTR_TYPE=user
+if [ "$FSTYP" == "xfs" ]; then
+	ATTR_TYPE=trusted
+	while $SETFATTR_PROG -n $ATTR_TYPE.$i -v $(cat $VFILE) $TFILE &>/dev/null; do
+		((++i))
+	done
+fi
 ret=0
 while [ $ret -eq 0 ]; do
 	ret=1
@@ -77,7 +93,7 @@ while [ $ret -eq 0 ]; do
 		# On btrfs, setfattr will sometimes fail when free space is
 		# low, long before it's actually exhausted. Insist until it
 		# fails consistently.
-		$SETFATTR_PROG -n user.$i"x"$j $TFILE &>/dev/null
+		$SETFATTR_PROG -n $ATTR_TYPE.$i"x"$j $TFILE &>/dev/null
 		ret=$(( $ret && $? ))
 		((++j))
 	done
-- 
2.1.4


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

end of thread, other threads:[~2017-08-02 20:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-01  4:55 [PATCH] generic/449: make the test effective against xfs Ernesto A. Fernández
2017-08-02  1:33 ` Eryu Guan
2017-08-02  4:12   ` Ernesto A. Fernández
2017-08-02  4:19 ` [PATCH v2] " Ernesto A. Fernández
2017-08-02  7:00   ` Eryu Guan
2017-08-02 15:48     ` Ernesto A. Fernández
2017-08-02 17:33       ` Darrick J. Wong
2017-08-02 20:59         ` Ernesto A. Fernández

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.