Whamcloud - gitweb
Fix problem with multiple connections to the same local device.
[fs/lustre-release.git] / lustre / llite / namei.c
index 30dac44..df8edbd 100644 (file)
@@ -155,7 +155,9 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
 
         err = ll_lock(dir, dentry, it, &lockh);
         if (err < 0) {
-                /* FIXME: Mike handle EINTR here */
+                /* FIXME: Mike LBUG() can disappear the moment that 
+                 *   ll_lock has sane interrupt behavior 
+                 */
                 LBUG();
                 RETURN(ERR_PTR(err));
         }
@@ -176,6 +178,7 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
                 memcpy(&lli->lli_intent_lock_handle, &lockh, sizeof(lockh));
 
                 ino = ll_inode_by_name(dir, dentry, &type);
+#warning FIXME: handle negative inode case (see old ll_lookup)
 
                 err = mdc_getattr(&sbi->ll_mdc_conn, ino, type,
                                   OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 0, &request);
@@ -200,16 +203,17 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
         } else
                 md.md = NULL;
 
+        /* No rpc's happen during iget4, -ENOMEM's are possible */
         inode = iget4(dir->i_sb, ino, ll_find_inode, &md);
-
         if (it->it_op & IT_RENAME)
                 it->it_data = dentry;
 
  out_req:
         ptlrpc_free_req(request);
-        if (!inode)
+        if (!inode || IS_ERR(inode)) { 
+                ll_intent_release(dentry); 
                 RETURN(ERR_PTR(-ENOMEM));
-
+        }
         EXIT;
  negative:
         dentry->d_op = &ll_d_ops;