From: David Disseldorp <ddiss@suse.de>
To: fstests@vger.kernel.org
Cc: dchinner@redhat.com, David Disseldorp <ddiss@suse.de>
Subject: [PATCH v2 3/3] generic/020: fix unaligned MAX_ATTRVAL_SIZE output filter
Date: Tue, 12 Apr 2022 12:50:01 +0200 [thread overview]
Message-ID: <20220412105001.14325-4-ddiss@suse.de> (raw)
In-Reply-To: <20220412105001.14325-1-ddiss@suse.de>
The current attr -g "$max_attrval_name" output filter is broken if
MAX_ATTRVAL_SIZE isn't 16-byte aligned, due to od's duplicate
suppression behaviour.
Fix it by having od only dump one byte per line.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
tests/generic/020 | 2 +-
tests/generic/020.out | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/generic/020 b/tests/generic/020
index 34861401..d1913953 100755
--- a/tests/generic/020
+++ b/tests/generic/020
@@ -134,7 +134,7 @@ dd if=/dev/zero bs=1 count=$MAX_ATTRVAL_SIZE 2>/dev/null \
| _attr -s "$max_attrval_name" $testfile >/dev/null
OCTAL_SIZE=`echo "obase=8; $MAX_ATTRVAL_SIZE" | bc`
-_attr -q -g "$max_attrval_name" $testfile | od -t x1 \
+_attr -q -g "$max_attrval_name" $testfile | od -w1 -t x1 \
| sed -e "s/^0*$OCTAL_SIZE$/ATTRSIZE/"
_attr -r "$max_attrval_name" $testfile >/dev/null
diff --git a/tests/generic/020.out b/tests/generic/020.out
index 7e3e65bd..0dc5e09f 100644
--- a/tests/generic/020.out
+++ b/tests/generic/020.out
@@ -47,7 +47,7 @@ user.snrub="fish2\012"
user.snrub="fish2\012"
*** really long value
-0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0000000 00
*
ATTRSIZE
*** set/get/remove really long names (expect failure)
--
2.34.1
next prev parent reply other threads:[~2022-04-12 11:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 10:49 [PATCH v2 0/3]: generic/020: fix MAX_ATTRVAL_SIZE values David Disseldorp
2022-04-12 10:49 ` [PATCH v2 1/3] common/attr: add and use _attr_get_max() David Disseldorp
2022-04-13 0:31 ` Dave Chinner
2022-04-12 10:50 ` [PATCH v2 2/3] common/attr: fix MAX_ATTRVAL_SIZE for XFS, UDF, Btrfs and NFS David Disseldorp
2022-04-12 10:50 ` David Disseldorp [this message]
2022-04-13 0:32 ` [PATCH v2 3/3] generic/020: fix unaligned MAX_ATTRVAL_SIZE output filter Dave Chinner
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=20220412105001.14325-4-ddiss@suse.de \
--to=ddiss@suse.de \
--cc=dchinner@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