From: Peng Tao Date: Thu, 20 Sep 2012 09:09:49 +0000 (+0800) Subject: LU-2019 llite: update i_flags in ll_iocontrol properly X-Git-Tag: 2.3.54~6 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b32074ad81953df481e620e4dbf011b77ad96a53;hp=5e314327f35535075f77c0b149e96db4c520fdd9;ds=sidebyside LU-2019 llite: update i_flags in ll_iocontrol properly When client has lsm, we still need to update cache i_flags. Otherwise i_flags is out of sync. Signed-off-by: Peng Tao Change-Id: I7fcb84da82129238f327885a0fc5827fcac90a8d Reviewed-on: http://review.whamcloud.com/4078 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Jinshan Xiong Reviewed-by: Nathaniel Clark Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 627703e..2cb5910 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1964,17 +1964,17 @@ int ll_iocontrol(struct inode *inode, struct file *file, if (rc) RETURN(rc); - OBDO_ALLOC(oinfo.oi_oa); - if (!oinfo.oi_oa) - RETURN(-ENOMEM); + inode->i_flags = ll_ext_to_inode_flags(flags); lsm = ccc_inode_lsm_get(inode); - if (lsm == NULL) { - inode->i_flags = ll_ext_to_inode_flags(flags); - OBDO_FREE(oinfo.oi_oa); + if (lsm == NULL) RETURN(0); - } + OBDO_ALLOC(oinfo.oi_oa); + if (!oinfo.oi_oa) { + ccc_inode_lsm_put(inode, lsm); + RETURN(-ENOMEM); + } oinfo.oi_md = lsm; oinfo.oi_oa->o_id = lsm->lsm_object_id; oinfo.oi_oa->o_seq = lsm->lsm_object_seq;