Whamcloud - gitweb
b=2334
authorphil <phil>
Fri, 5 Dec 2003 17:46:41 +0000 (17:46 +0000)
committerphil <phil>
Fri, 5 Dec 2003 17:46:41 +0000 (17:46 +0000)
A slight reorganization of ll_intent_release, so we can drop the MDS
lock early.

lustre/llite/dcache.c
lustre/llite/llite_internal.h
lustre/llite/namei.c

index d82b47b..8b30963 100644 (file)
@@ -62,10 +62,9 @@ void ll_set_dd(struct dentry *de)
         EXIT;
 }
 
-void ll_intent_release(struct lookup_intent *it)
+void ll_intent_drop_lock(struct lookup_intent *it)
 {
         struct lustre_handle *handle;
-        ENTRY;
 
         if (it->it_op && it->d.lustre.it_lock_mode) {
                 handle = (struct lustre_handle *)&it->d.lustre.it_lock_handle;
@@ -73,11 +72,17 @@ void ll_intent_release(struct lookup_intent *it)
                        " from it %p\n", handle->cookie, it);
                 ldlm_lock_decref(handle, it->d.lustre.it_lock_mode);
 
-                /* intent_release may be called multiple times, from
-                   this thread and we don't want to double-decref this
-                   lock (see bug 494) */
+                /* bug 494: intent_release may be called multiple times, from
+                 * this thread and we don't want to double-decref this lock */
                 it->d.lustre.it_lock_mode = 0;
         }
+}
+
+void ll_intent_release(struct lookup_intent *it)
+{
+        ENTRY;
+
+        ll_intent_drop_lock(it);
         it->it_magic = 0;
         it->it_op_release = 0;
         it->d.lustre.it_disposition = 0;
index 14e04a7..bf97b5f 100644 (file)
@@ -178,6 +178,7 @@ extern struct file_operations ll_special_fifo_file_fops;
 extern struct file_operations ll_special_sock_inode_fops;
 
 /* llite/dcache.c */
+void ll_intent_drop_lock(struct lookup_intent *);
 void ll_intent_release(struct lookup_intent *);
 extern void ll_set_dd(struct dentry *de);
 void ll_unhash_aliases(struct inode *);
index e768933..f5bacb5 100644 (file)
@@ -348,6 +348,9 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
         if (rc < 0)
                 GOTO(out, retval = ERR_PTR(rc));
 
+        /* bug 2334: drop MDS lock before acquiring OST lock */
+        ll_intent_drop_lock(it);
+
         rc = lookup_it_finish(req, 1, it, &icbd);
         if (rc != 0) {
                 ll_intent_release(it);