Whamcloud - gitweb
- fixed using not initialized ctxt with pop_ctxt() in mds_lock_and_check_slave()
authoryury <yury>
Fri, 11 Mar 2005 18:24:01 +0000 (18:24 +0000)
committeryury <yury>
Fri, 11 Mar 2005 18:24:01 +0000 (18:24 +0000)
lustre/mds/mds_lmv.c

index e406fd7..0287b11 100644 (file)
@@ -1169,11 +1169,10 @@ int mds_lock_and_check_slave(int offset, struct ptlrpc_request *req,
         }
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
         }
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
+       rc = mds_is_dir_empty(obd, dentry) ? 0 : -ENOTEMPTY;
+        pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
 
 
-        rc = 0;
-        if (!mds_is_dir_empty(obd, dentry))
-                rc = -ENOTEMPTY;
-
+        mds_exit_ucred(&uc);
         EXIT;
 cleanup:
         switch(cleanup_phase) {
         EXIT;
 cleanup:
         switch(cleanup_phase) {
@@ -1181,8 +1180,6 @@ cleanup:
                 if (rc)
                         ldlm_lock_decref(lockh, LCK_EX);
                 l_dput(dentry);
                 if (rc)
                         ldlm_lock_decref(lockh, LCK_EX);
                 l_dput(dentry);
-                pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &uc);
-                mds_exit_ucred(&uc);
         default:
                 break;
         }
         default:
                 break;
         }