Skip to contentSkip to conversation

remove-NFS-close-to-open from V

RFC PATCH Petr Vandrovec 1 participant 1 message Oct 17, 2002 VFS

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Jan Harkes

Originally, returning a error from d_revalidate in cached_lookup would force a subsequent real_lookup. After the patch, returning an error from d_revalidate propagates (in some cases) ESTALE back up to userspace.

For example if you do 'ls -l' in root directory of mounted ncpfs filesystem because of ncpfs did not expect that somebody can call it with entry name "/" (which contains illegal character for filename, '/'), and so it refused to believe that such entry is valid...
Best regards,
Petr Vandrovec [email protected]

Quoted 28 lines
fs/namei.c Tue Mar 12 07:35:02 2002 renamed from fs/namei.c Thu Feb 28 05:57:29 2002 +13 -1
@@ -627,6 +627,19 @@
        nd->last_type = LAST_DOT;
    else if (this.len == 2 && this.name[1] == '.')
        nd->last_type = LAST_DOTDOT;
+return_reval:
+       /*
+        * We bypassed the ordinary revalidation routines.
+        * Check the cached dentry for staleness.
+        */
+       dentry = nd->dentry;
+       if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
+           err = -ESTALE;
+           if (!dentry->d_op->d_revalidate(dentry, 0)) {
+               d_invalidate(dentry);
+               break;
+           }
+       }
 return_base:
    return 0;
 out_dput:
 
-

To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html