Whamcloud - gitweb
LU-11662 llite: handle -ENODATA in ll_layout_fetch() 65/33665/3
authorJohn L. Hammond <jhammond@whamcloud.com>
Thu, 15 Nov 2018 17:08:57 +0000 (11:08 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Nov 2018 04:57:23 +0000 (04:57 +0000)
In ll_layout_fetch() handle -ENODATA returns from mdc_getxattr(). This
is needed for interop and restores the behavior from before commit
0f42b388432c4b898857660197ef13a40a82cd9d (LU-11380 mdc: move empty
xattr to mdc layer) landed.

Test-Parameters: clientjob=lustre-b2_10 clientbuildno=136 testlist=sanity-hsm
Test-Parameters: mdsjob=lustre-b2_10 ossjob=lustre-b2_10 serverbuildno=136 testlist=sanity-hsm
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I1fb85faf35c7d2303a1f61a5a9c5922988739817
Reviewed-on: https://review.whamcloud.com/33665
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c

index f866fba..9a4bd91 100644 (file)
@@ -4956,8 +4956,12 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
 
        rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), OBD_MD_FLXATTR,
                         XATTR_NAME_LOV, lmmsize, &req);
-       if (rc < 0)
-               RETURN(rc);
+       if (rc < 0) {
+               if (rc == -ENODATA)
+                       GOTO(out, rc = 0); /* empty layout */
+               else
+                       RETURN(rc);
+       }
 
        lmmsize = rc;
        rc = 0;