]> err.no Git - linux-2.6/blobdiff - fs/autofs4/root.c
[PATCH] remove verify_area(): remove or edit references to verify_area in Documentation/
[linux-2.6] / fs / autofs4 / root.c
index 3765c047f157e76f4e1e760460db22e71c3744a0..2a771ec66956f92615de35694dc512f0144aedba 100644 (file)
@@ -205,7 +205,11 @@ static int autofs4_dir_open(struct inode *inode, struct file *file)
                struct vfsmount *fp_mnt = mntget(mnt);
                struct dentry *fp_dentry = dget(dentry);
 
-               while (follow_down(&fp_mnt, &fp_dentry) && d_mountpoint(fp_dentry));
+               if (!autofs4_follow_mount(&fp_mnt, &fp_dentry)) {
+                       dput(fp_dentry);
+                       mntput(fp_mnt);
+                       return -ENOENT;
+               }
 
                fp = dentry_open(fp_dentry, fp_mnt, file->f_flags);
                status = PTR_ERR(fp);
@@ -302,7 +306,14 @@ static int try_to_fill_dentry(struct dentry *dentry,
                
                DPRINTK("expire done status=%d", status);
                
-               return 0;
+               /*
+                * If the directory still exists the mount request must
+                * continue otherwise it can't be followed at the right
+                * time during the walk.
+                */
+               status = d_invalidate(dentry);
+               if (status != -EBUSY)
+                       return 0;
        }
 
        DPRINTK("dentry=%p %.*s ino=%p",