Whamcloud - gitweb
b=22095 MDS operations hang when issued with lfs setstripe on a degraded OST
authorDmitry Zogin <dmitry.zogin@sun.com>
Thu, 4 Mar 2010 18:03:14 +0000 (13:03 -0500)
committerJohann Lombardi <johann@sun.com>
Fri, 5 Mar 2010 21:35:03 +0000 (22:35 +0100)
 Change the locking order in mds_lookup()

 o=jfilizetti@sms-fed.com
 i=johann
 i=adilger

lustre/mds/mds_reint.c

index 97dc613..e71fe2c 100644 (file)
@@ -98,15 +98,17 @@ struct dentry *mds_lookup(struct obd_device *obd, const char *fid_name,
                 struct inode *inode = dchild->d_inode; 
                 void         *handle;
                 if (inode != NULL) {
+                        LOCK_INODE_MUTEX(inode);
                         handle = fsfilt_start(obd, inode, FSFILT_OP_SETATTR,
                                               NULL);
                         if (!IS_ERR(handle)) {
-                                LOCK_INODE_MUTEX(inode);
                                 fsfilt_set_md(obd, inode, handle, NULL, 0,
                                               "lma");
                                 /* result is ignored. */
                                 UNLOCK_INODE_MUTEX(inode);
                                 fsfilt_commit(obd, inode, handle, 0);
+                        } else {
+                                UNLOCK_INODE_MUTEX(inode);
                         }
                 }
         }