CIFS: fix automount for DFS shares
authorGerlando Falauto <gerlando.falauto@keymile.com>
Tue, 18 Oct 2011 08:58:50 +0000 (10:58 +0200)
committerSteve French <smfrench@gmail.com>
Tue, 18 Oct 2011 15:49:38 +0000 (10:49 -0500)
Automounting directories are now invalidated by .d_revalidate()
so to be d_instantiate()d again with the right DCACHE_NEED_AUTOMOUNT
flag

Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/dir.c

index 0c8098d54d2b80e44e51aa66097475bd0d3ae584..d7eeb9d3ed6feae9a8c25f9e71d7822efba3e488 100644 (file)
@@ -648,8 +648,16 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
        if (direntry->d_inode) {
                if (cifs_revalidate_dentry(direntry))
                        return 0;
-               else
+               else {
+                       /*
+                        * Forcibly invalidate automounting directory inodes
+                        * (remote DFS directories) so to have them
+                        * instantiated again for automount
+                        */
+                       if (IS_AUTOMOUNT(direntry->d_inode))
+                               return 0;
                        return 1;
+               }
        }
 
        /*