From b32074ad81953df481e620e4dbf011b77ad96a53 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Thu, 20 Sep 2012 17:09:49 +0800 Subject: [PATCH 1/1] 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 --- lustre/llite/llite_lib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; -- 1.8.3.1