From e3f367f3660dc53b690934d42bc5019a292d81bc Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 15 Nov 2018 11:08:57 -0600 Subject: [PATCH] LU-11662 llite: handle -ENODATA in ll_layout_fetch() 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 Change-Id: I1fb85faf35c7d2303a1f61a5a9c5922988739817 Reviewed-on: https://review.whamcloud.com/33665 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/llite/file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index f866fba..9a4bd91 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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; -- 1.8.3.1