[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160306035514.GH10297@thunk.org>
Date: Sat, 5 Mar 2016 22:55:14 -0500
From: Theodore Ts'o <tytso@....edu>
To: "Darrick J. Wong" <darrick.wong@...cle.com>
Cc: linux-ext4@...r.kernel.org, Darren Hart <dvhart@...ux.intel.com>,
Richard Purdie <richard.purdie@...uxfoundation.org>
Subject: Re: [PATCH 9/9] libext2fs: sort keys for xattr blocks
On Sat, Feb 13, 2016 at 02:38:24PM -0800, Darrick J. Wong wrote:
> Richard Purdie reports that libext2fs doesn't sort attribute keys in
> the xattr block correctly, causing the kernel to return -ENODATA when
> querying attributes that should be there. Therefore, sort attributes
> so that whatever ends up in the xattr block is sorted according to
> what the kernel expects.
>
> Cc: Darren Hart <dvhart@...ux.intel.com>
> Reported-by: Richard Purdie <richard.purdie@...uxfoundation.org>
> Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
Applied, with one minor change. You should never use something like
/tmp/b in a test script becuase it's possible that /tmp/b might
already exist, and might be not even owned by the user. (In my case
/tmp/b was a root owned file that was sufficiently big that it it
caused ea_set command to fail with a "out of space" error.)
If /tmp/b was writable by the user and was something previous, then
the developer might get after the test script executes "rm -rf /tmp/b".
- Ted
diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script
index 30c189a..30187f1 100644
--- a/tests/d_xattr_sorting/script
+++ b/tests/d_xattr_sorting/script
@@ -17,16 +17,18 @@ $MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
status=$?
echo Exit status is $status >> $OUT
-perl -e 'print "x" x 256;' > /tmp/b
+B=$(mktemp ${TMPDIR:-/tmp}/b.XXXXXX)
+
+perl -e 'print "x" x 256;' > $B
echo "ea_set / security.SMEG64 -f /tmp/b" > $OUT.new
-$DEBUGFS -w -R "ea_set / security.SMEG64 -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
+$DEBUGFS -w -R "ea_set / security.SMEG64 -f $B" $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
echo "ea_set / security.imb -f /tmp/b" > $OUT.new
-$DEBUGFS -w -R "ea_set / security.imb -f /tmp/b" $TMPFILE >> $OUT.new 2>&1
+$DEBUGFS -w -R "ea_set / security.imb -f $B" $TMPFILE >> $OUT.new 2>&1
status=$?
echo Exit status is $status >> $OUT.new
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
@@ -37,7 +39,8 @@ status=$?
echo Exit status is $status >> $OUT.new
sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
-rm -rf /tmp/b
+rm -f $B
+unset B
echo "ea_list /" > $OUT.new
$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists