Whamcloud - gitweb
LU-13937 osd: OST with isize < 256 stripe info stored in LMA 90/39790/7
authorArtem Blagodarenko <artem.blagodarenko@hpe.com>
Tue, 1 Sep 2020 19:47:22 +0000 (15:47 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 5 May 2021 02:49:10 +0000 (02:49 +0000)
osd_xattr_set_pfid() expects XATTR_NAME_FID to be exist if
LMAC_STRIPE_INF is absent and delete it if LU_XATTR_REPLACE is set.
There are some cases, after upgrade, when LMAC_STRIPE_INF is absent
and there is no XATTR_NAME_FID.

No need return -ENODATA to the client, because having XATTR_NAME_FID
absent is what situation requires, so osd_xattr_set_pfid() can
continue to fill LMA.

Change-Id: If1690204912ba0875e2251264eb28286e930b3a7
hpe-bug-id: LUS-9106
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Reviewed-on: https://review.whamcloud.com/39790
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 2971dec..2c6741a 100644 (file)
@@ -4631,8 +4631,8 @@ static int osd_xattr_set_pfid(const struct lu_env *env, struct osd_object *obj,
                dquot_initialize(inode);
                rc = ll_vfs_removexattr(dentry, inode, XATTR_NAME_FID);
                if (rc == -ENODATA) {
                dquot_initialize(inode);
                rc = ll_vfs_removexattr(dentry, inode, XATTR_NAME_FID);
                if (rc == -ENODATA) {
-                       if ((fl & LU_XATTR_REPLACE) && !(fl & LU_XATTR_CREATE))
-                               RETURN(rc);
+                       /* XATTR_NAME_FID is already absent */
+                       rc = 0;
                } else if (rc) {
                        RETURN(rc);
                }
                } else if (rc) {
                        RETURN(rc);
                }