Whamcloud - gitweb
b=19151
[fs/lustre-release.git] / lustre / llite / dcache.c
index 0f7c7e6..cf1f734 100644 (file)
@@ -393,17 +393,20 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
                 GOTO(out_sa, rc);
         }
 
-        exp = ll_i2mdexp(de->d_inode);
-
         /* Never execute intents for mount points.
          * Attributes will be fixed up in ll_inode_revalidate_it */
         if (d_mountpoint(de))
                 GOTO(out_sa, rc = 1);
 
-        /* Root of the lustre tree. Always valid.
-         * Attributes will be fixed up in ll_inode_revalidate_it */
-        if (de == de->d_sb->s_root)
-                GOTO(out_sa, rc = 1);
+        /* need to get attributes in case root got changed from other client */
+        if (de == de->d_sb->s_root) {
+                rc = __ll_inode_revalidate_it(de, it, MDS_INODELOCK_LOOKUP);
+                if (rc == 0)
+                        rc = 1;
+                GOTO(out_sa, rc);
+        }
+
+        exp = ll_i2mdexp(de->d_inode);
 
         OBD_FAIL_TIMEOUT(OBD_FAIL_MDC_REVALIDATE_PAUSE, 5);
         ll_frob_intent(&it, &lookup_it);
@@ -470,11 +473,11 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,
 
 do_lock:
         it->it_create_mode &= ~current->fs->umask;
-        it->it_flags |= O_CHECK_STALE;
+        it->it_create_mode |= M_CHECK_STALE;
         rc = md_intent_lock(exp, op_data, NULL, 0, it,
                             lookup_flags,
                             &req, ll_md_blocking_ast, 0);
-        it->it_flags &= ~O_CHECK_STALE;
+        it->it_create_mode &= ~M_CHECK_STALE;
         ll_finish_md_op_data(op_data);
         if (it->it_op == IT_GETATTR && !first)
                 /* If there are too many locks on client-side, then some
@@ -718,7 +721,7 @@ out_sa:
 }
 
 #ifdef HAVE_VFS_INTENT_PATCHES
-static int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
+int ll_revalidate_nd(struct dentry *dentry, struct nameidata *nd)
 {
         int rc;
         ENTRY;