]> err.no Git - linux-2.6/blobdiff - fs/autofs4/waitq.c
[PATCH] Clean up struct flock definitions
[linux-2.6] / fs / autofs4 / waitq.c
index 5a40d36e5a5101f178a92703b818487925db882d..3df86285a1c7e981e054d145fb134b89673336ab 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 ) {
@@ -224,8 +231,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
                int type = (notify == NFY_MOUNT ?
                        autofs_ptype_missing : autofs_ptype_expire_multi);
 
-               DPRINTK(("new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
-                       (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify));
+               DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
+                       (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
 
                /* autofs4_notify_daemon() may block */
                autofs4_notify_daemon(sbi, wq, type);