]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/autofs4/waitq.c
[PATCH] autofs4: post expire race fix
[linux-2.6-omap-h63xx.git] / fs / autofs4 / waitq.c
index 5a40d36e5a5101f178a92703b818487925db882d..fa2348dcd6718732c3f8bfb4ad2ecfe52c323aad 100644 (file)
@@ -191,6 +191,13 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
        }
 
        if ( !wq ) {
+               /* Can't wait for an expire if there's no mount */
+               if (notify == NFY_NONE && !d_mountpoint(dentry)) {
+                       kfree(name);
+                       up(&sbi->wq_sem);
+                       return -ENOENT;
+               }
+
                /* Create a new wait queue */
                wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
                if ( !wq ) {