Whamcloud - gitweb
LU-2019 llite: update i_flags in ll_iocontrol properly
authorPeng Tao <tao.peng@emc.com>
Thu, 20 Sep 2012 09:09:49 +0000 (17:09 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 29 Oct 2012 06:00:43 +0000 (02:00 -0400)
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>
lustre/llite/llite_lib.c

index 627703e..2cb5910 100644 (file)
@@ -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;