Whamcloud - gitweb
b=17807
[fs/lustre-release.git] / lustre / llite / dcache.c
index 40be3e6..31fdff5 100644 (file)
@@ -493,17 +493,16 @@ do_lock:
         }
 
         if (rc < 0) {
-                if (-ESTALE == rc) {
+                if (rc != -ESTALE) {
+                        CDEBUG(D_INFO, "ll_intent_lock: rc %d : it->it_status "
+                               "%d\n", rc, it->d.lustre.it_status);
+                } else {
+#ifndef HAVE_VFS_INTENT_PATCHES
                         if (it_disposition(it, DISP_OPEN_OPEN) &&
                             !it_open_error(DISP_OPEN_OPEN, it))
                                 /* server have valid open - close file first*/
                                 ll_release_openhandle(de, it);
-                        /* release intent reference to avoid having stale 'it'
-                         * in namedata for old VFS intent */
-                        ll_intent_drop_lock(it);
-                } else {
-                        CDEBUG(D_INFO, "ll_intent_lock: rc %d : it->it_status "
-                               "%d\n", rc, it->d.lustre.it_status);
+#endif
                 }
                 GOTO(out, rc = 0);
         }
@@ -771,7 +770,7 @@ int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
  * nd->intent.open.file for error, so we need to return it as lookup's result
  * instead */
                                 if (IS_ERR(filp))
-                                        rc = 0;
+                                        rc = PTR_ERR(filp);
 #endif
                         }
 #else