]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/root.c
[PATCH] autofs4: NFY_NONE wait race fix
[linux-2.6-omap-h63xx.git] / fs / autofs4 / root.c
index 84e030c8ddd0f99047473308afc4d26f555e2c14..5100f984783faa123caabf76ad97e1718bdea70e 100644 (file)
@@ -327,6 +327,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags)
 static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
+       struct autofs_info *ino = autofs4_dentry_ino(dentry);
        int oz_mode = autofs4_oz_mode(sbi);
        unsigned int lookup_type;
        int status;
@@ -340,13 +341,8 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
        if (oz_mode || !lookup_type)
                goto done;
 
-       /*
-        * If a request is pending wait for it.
-        * If it's a mount then it won't be expired till at least
-        * a liitle later and if it's an expire then we might need
-        * to mount it again.
-        */
-       if (autofs4_ispending(dentry)) {
+       /* If an expire request is pending wait for it. */
+       if (ino && (ino->flags & AUTOFS_INF_EXPIRING)) {
                DPRINTK("waiting for active request %p name=%.*s",
                        dentry, dentry->d_name.len, dentry->d_name.name);