When client has lsm, we still need to update cache i_flags.
Otherwise i_flags is out of sync.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I7fcb84da82129238f327885a0fc5827fcac90a8d
Reviewed-on: http://review.whamcloud.com/4078
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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;