Whamcloud - gitweb
Branch b1_8
authorw.li <w.li>
Wed, 2 Sep 2009 13:07:24 +0000 (13:07 +0000)
committerw.li <w.li>
Wed, 2 Sep 2009 13:07:24 +0000 (13:07 +0000)
b=20347
i=tappro
i=yong.fan

In llite's SETFLAGS ioctl, the local i_flags should be updated even when
"lsm == NULL".

lustre/llite/llite_lib.c

index 04a0d13..50589bf 100644 (file)
@@ -2155,11 +2155,16 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                 rc = mdc_setattr(sbi->ll_mdc_exp, &op_data,
                                  (struct iattr *)&attr, NULL, 0, NULL, 0, &req);
                 ptlrpc_req_finished(req);
-                if (rc || lsm == NULL) {
+                if (rc) {
                         OBDO_FREE(oinfo.oi_oa);
                         RETURN(rc);
                 }
 
+                if (lsm == NULL) {
+                        OBDO_FREE(oinfo.oi_oa);
+                        GOTO(update_cache, rc);
+                }
+
                 oinfo.oi_oa->o_id = lsm->lsm_object_id;
                 oinfo.oi_oa->o_gr = lsm->lsm_object_gr;
                 oinfo.oi_oa->o_flags = flags;
@@ -2172,13 +2177,15 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                 OBDO_FREE(oinfo.oi_oa);
                 if (rc) {
                         if (rc != -EPERM && rc != -EACCES)
-                                CERROR("mdc_setattr_async fails: rc = %d\n", rc);
+                                CERROR("osc_setattr_async fails: rc = %d\n",rc);
                         RETURN(rc);
                 }
 
+                EXIT;
+update_cache:
                 inode->i_flags = ll_ext_to_inode_flags(flags |
                                                        MDS_BFLAG_EXT_FLAGS);
-                RETURN(0);
+                return 0;
         }
         default:
                 RETURN(-ENOSYS);