From ca41d88d9228e469a8728c20c21c7e919b77dc12 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Thu, 15 Jun 2017 16:01:13 +0800 Subject: [PATCH] LU-9485 llite: check the return value of cl_file_inode_init() ll_update_inode() does not check the return value of cl_file_inode_init(), and it should check. Signed-off-by: Bobi Jam Change-Id: I4174e4f8166d7834a1d619aa8d0191d1f428c62c Reviewed-on: https://review.whamcloud.com/27658 Tested-by: Jenkins Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/llite/llite_lib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index a1a8163..10fef55 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1830,13 +1830,15 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md) struct ll_inode_info *lli = ll_i2info(inode); struct mdt_body *body = md->body; struct ll_sb_info *sbi = ll_i2sbi(inode); + int rc = 0; - if (body->mbo_valid & OBD_MD_FLEASIZE) - cl_file_inode_init(inode, md); + if (body->mbo_valid & OBD_MD_FLEASIZE) { + rc = cl_file_inode_init(inode, md); + if (rc) + return rc; + } if (S_ISDIR(inode->i_mode)) { - int rc; - rc = ll_update_lsm_md(inode, md); if (rc != 0) return rc; -- 1.8.3.1