Whamcloud - gitweb
EX-5249 utils: don't complain for missing lustre.pin
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 23 Jun 2022 22:04:05 +0000 (16:04 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Jun 2022 02:12:18 +0000 (02:12 +0000)
Don't print an error when running "lfs pcc status" against an older
server without the "lustre.pin" xattr returns EOPNOTSUPP.

Test-Parameters: trivial testlist=sanity-pcc serverversion=2.14.0-ddn23
Fixes: f9970c0a70 ("EX-5249 utils: show pin information in 'lfs pcc state' command")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iab235b8be497386752915baeb31347cf8137eed0
Reviewed-on: https://review.whamcloud.com/47723
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Feng, Lei <flei@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/utils/lfs.c

index b958c5e..2980940 100644 (file)
@@ -12509,7 +12509,13 @@ static int lfs_pcc_state(int argc, char **argv)
 
                rc2 = getxattr(path, XATTR_LUSTRE_PIN, buff, sizeof(buff));
                if (rc2 < 0) {
-                       if (errno != ENODATA) {
+                       /* since this is using "lustre.pin" to allow non-root
+                        * users read access and not "trusted.pin", older
+                        * servers will return EOPNOTSUPP since the "lustre"
+                        * namespace is individually mapped to specific
+                        * "trusted.foo" xattrs and is otherwise unimplemented.
+                        */
+                       if (errno != ENODATA && errno != EOPNOTSUPP) {
                                if (rc == 0)
                                        rc = -errno;
                                fprintf(stderr,