From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Subject: [PATCH] xfstests: fix 062 for newer kernels (v3.0+)
Date: Thu, 18 Aug 2011 16:48:43 -0500 [thread overview]
Message-ID: <4E4D88BB.4020807@redhat.com> (raw)
Commit 55b23bde19c08f14127a27d461a4e079942c7258,
xattr: Fix error results for non-existent / invisible attributes
changed the error return for getfattr on a link:
Return -ENODATA when trying to read a user.* attribute which cannot
exist: user space otherwise does not have a reasonable way to
distinguish between non-existent and inaccessible attributes.
via:
if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
- return -EPERM;
+ return (mask & MAY_WRITE) ? -EPERM : -ENODATA;
So, I propose just filtering both error values to "Failure" as below.
Reported-by: Jeff MOyer <jmoyer@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/062 b/062
index a6e4bc8..709f336 100755
--- a/062
+++ b/062
@@ -46,9 +46,12 @@ _cleanup()
}
trap "_cleanup; exit \$status" 0 1 2 3 15
+# getfattr can fail in 2 ways depending on kernel version; see
+# commit 55b23bde19c08f14127a27d461a4e079942c7258 upstream
getfattr()
{
- $GETFATTR_PROG --absolute-names -dh $@ 2>&1 | _filter_scratch
+ $GETFATTR_PROG --absolute-names -dh $@ 2>&1 | _filter_scratch \
+ | sed -e "s/No such attribute\|Operation not permitted/Failure/"
}
setfattr()
diff --git a/062.out b/062.out
index 1d5a094..8377b30 100644
--- a/062.out
+++ b/062.out
@@ -49,7 +49,7 @@ user.name2
user.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/reg: user.name2: No such attribute
+SCRATCH_MNT/reg: user.name2: Failure
*** final list (strings, type=reg, nsp=user)
# file: SCRATCH_MNT/reg
user.name=0xbabe
@@ -96,7 +96,7 @@ user.name2
user.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/dir: user.name2: No such attribute
+SCRATCH_MNT/dir: user.name2: Failure
*** final list (strings, type=dir, nsp=user)
# file: SCRATCH_MNT/dir
user.name=0xbabe
@@ -119,13 +119,13 @@ setfattr: SCRATCH_MNT/lnk: Operation not permitted
setfattr: SCRATCH_MNT/lnk: Operation not permitted
*** set an empty value for second attribute
setfattr: SCRATCH_MNT/lnk: Operation not permitted
-SCRATCH_MNT/lnk: user.name2: Operation not permitted
+SCRATCH_MNT/lnk: user.name2: Failure
*** overwrite empty value
setfattr: SCRATCH_MNT/lnk: Operation not permitted
-SCRATCH_MNT/lnk: user.name2: Operation not permitted
+SCRATCH_MNT/lnk: user.name2: Failure
*** remove attribute
setfattr: SCRATCH_MNT/lnk: Operation not permitted
-SCRATCH_MNT/lnk: user.name2: Operation not permitted
+SCRATCH_MNT/lnk: user.name2: Failure
*** final list (strings, type=lnk, nsp=user)
=== TYPE dev/b; NAMESPACE user
@@ -144,13 +144,13 @@ setfattr: SCRATCH_MNT/dev/b: Operation not permitted
setfattr: SCRATCH_MNT/dev/b: Operation not permitted
*** set an empty value for second attribute
setfattr: SCRATCH_MNT/dev/b: Operation not permitted
-SCRATCH_MNT/dev/b: user.name2: Operation not permitted
+SCRATCH_MNT/dev/b: user.name2: Failure
*** overwrite empty value
setfattr: SCRATCH_MNT/dev/b: Operation not permitted
-SCRATCH_MNT/dev/b: user.name2: Operation not permitted
+SCRATCH_MNT/dev/b: user.name2: Failure
*** remove attribute
setfattr: SCRATCH_MNT/dev/b: Operation not permitted
-SCRATCH_MNT/dev/b: user.name2: Operation not permitted
+SCRATCH_MNT/dev/b: user.name2: Failure
*** final list (strings, type=dev/b, nsp=user)
=== TYPE dev/c; NAMESPACE user
@@ -169,13 +169,13 @@ setfattr: SCRATCH_MNT/dev/c: Operation not permitted
setfattr: SCRATCH_MNT/dev/c: Operation not permitted
*** set an empty value for second attribute
setfattr: SCRATCH_MNT/dev/c: Operation not permitted
-SCRATCH_MNT/dev/c: user.name2: Operation not permitted
+SCRATCH_MNT/dev/c: user.name2: Failure
*** overwrite empty value
setfattr: SCRATCH_MNT/dev/c: Operation not permitted
-SCRATCH_MNT/dev/c: user.name2: Operation not permitted
+SCRATCH_MNT/dev/c: user.name2: Failure
*** remove attribute
setfattr: SCRATCH_MNT/dev/c: Operation not permitted
-SCRATCH_MNT/dev/c: user.name2: Operation not permitted
+SCRATCH_MNT/dev/c: user.name2: Failure
*** final list (strings, type=dev/c, nsp=user)
=== TYPE dev/p; NAMESPACE user
@@ -194,13 +194,13 @@ setfattr: SCRATCH_MNT/dev/p: Operation not permitted
setfattr: SCRATCH_MNT/dev/p: Operation not permitted
*** set an empty value for second attribute
setfattr: SCRATCH_MNT/dev/p: Operation not permitted
-SCRATCH_MNT/dev/p: user.name2: Operation not permitted
+SCRATCH_MNT/dev/p: user.name2: Failure
*** overwrite empty value
setfattr: SCRATCH_MNT/dev/p: Operation not permitted
-SCRATCH_MNT/dev/p: user.name2: Operation not permitted
+SCRATCH_MNT/dev/p: user.name2: Failure
*** remove attribute
setfattr: SCRATCH_MNT/dev/p: Operation not permitted
-SCRATCH_MNT/dev/p: user.name2: Operation not permitted
+SCRATCH_MNT/dev/p: user.name2: Failure
*** final list (strings, type=dev/p, nsp=user)
=== TYPE reg; NAMESPACE trusted
@@ -243,7 +243,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/reg: trusted.name2: No such attribute
+SCRATCH_MNT/reg: trusted.name2: Failure
*** final list (strings, type=reg, nsp=trusted)
# file: SCRATCH_MNT/reg
trusted.name=0xbabe
@@ -292,7 +292,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/dir: trusted.name2: No such attribute
+SCRATCH_MNT/dir: trusted.name2: Failure
*** final list (strings, type=dir, nsp=trusted)
# file: SCRATCH_MNT/dir
trusted.name=0xbabe
@@ -341,7 +341,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/lnk: trusted.name2: No such attribute
+SCRATCH_MNT/lnk: trusted.name2: Failure
*** final list (strings, type=lnk, nsp=trusted)
# file: SCRATCH_MNT/lnk
trusted.name=0xbabe
@@ -388,7 +388,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/dev/b: trusted.name2: No such attribute
+SCRATCH_MNT/dev/b: trusted.name2: Failure
*** final list (strings, type=dev/b, nsp=trusted)
# file: SCRATCH_MNT/dev/b
trusted.name=0xbabe
@@ -435,7 +435,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/dev/c: trusted.name2: No such attribute
+SCRATCH_MNT/dev/c: trusted.name2: Failure
*** final list (strings, type=dev/c, nsp=trusted)
# file: SCRATCH_MNT/dev/c
trusted.name=0xbabe
@@ -482,7 +482,7 @@ trusted.name2
trusted.name2=0xcafe
*** remove attribute
-SCRATCH_MNT/dev/p: trusted.name2: No such attribute
+SCRATCH_MNT/dev/p: trusted.name2: Failure
*** final list (strings, type=dev/p, nsp=trusted)
# file: SCRATCH_MNT/dev/p
trusted.name=0xbabe
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2011-08-18 21:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 21:48 Eric Sandeen [this message]
2011-08-19 14:01 ` [PATCH] xfstests: fix 062 for newer kernels (v3.0+) Eric Sandeen
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=4E4D88BB.4020807@redhat.com \
--to=sandeen@redhat.com \
--cc=jmoyer@redhat.com \
--cc=xfs@oss.sgi.com \
/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 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.