public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>
To: fstests@vger.kernel.org
Cc: "Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>,
	"Eryu Guan" <eguan@redhat.com>
Subject: [PATCH v2] generic/449: make the test effective against xfs
Date: Wed, 2 Aug 2017 01:19:34 -0300	[thread overview]
Message-ID: <20170802041933.GB7310@debian.home> (raw)
In-Reply-To: <20170801045528.GA4696@debian.home>

Setting acls on an xfs filesystem will succeed even after running out
of space for user attributes. Use trusted attributes instead. Also speed
up the test by setting large values for the attributes.

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
---
Changes in v2:
  - The check for xfs actually worked for all filesystems, as Eryu Guan
    noticed. So the test is now much more straightforward.

 tests/generic/449 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/generic/449 b/tests/generic/449
index fb776b3..f5aad22 100755
--- a/tests/generic/449
+++ b/tests/generic/449
@@ -66,9 +66,17 @@ touch $TFILE
 chmod u+rwx $TFILE
 chmod go-rwx $TFILE
 
+# The content of this file will be used as the value of the attributes
+VFILE=$SCRATCH_MNT/valuefile
+touch $VFILE
+$XFS_IO_PROG -c "pwrite -S 0x2E 0 1k" $VFILE >>$seqres.full 2>&1
+
 # Try to run out of space so setfacl will fail
 $XFS_IO_PROG -c "pwrite 0 50m" $TFILE >>$seqres.full 2>&1
 i=1
+while $SETFATTR_PROG -n trusted.$i -v $(cat $VFILE) $TFILE &>/dev/null; do
+	((++i))
+done
 j=1
 ret=0
 while [ $ret -eq 0 ]; do
@@ -77,7 +85,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 trusted.$i"x"$j $TFILE &>/dev/null
 		ret=$(( $ret && $? ))
 		((++j))
 	done
-- 
2.1.4



  parent reply	other threads:[~2017-08-02  4:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ernesto A. Fernández [this message]
2017-08-02  7:00   ` [PATCH v2] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802041933.GB7310@debian.home \
    --to=ernesto.mnd.fernandez@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox