]> Pileus Git - ~andy/linux/blobdiff - fs/autofs4/root.c
Merge git://www.linux-watchdog.org/linux-watchdog
[~andy/linux] / fs / autofs4 / root.c
index c93447604da859bf5b3de0435c4d26852811bb95..9bd16255dd9cd631371acf3ed3ec276682ded828 100644 (file)
@@ -383,8 +383,10 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
                                goto done;
                        }
                } else {
-                       if (!simple_empty(dentry))
+                       if (!simple_empty(dentry)) {
+                               spin_unlock(&sbi->fs_lock);
                                goto done;
+                       }
                }
                ino->flags |= AUTOFS_INF_PENDING;
                spin_unlock(&sbi->fs_lock);
@@ -587,7 +589,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
        
        /* This allows root to remove symlinks */
        if (!autofs4_oz_mode(sbi) && !capable(CAP_SYS_ADMIN))
-               return -EACCES;
+               return -EPERM;
 
        if (atomic_dec_and_test(&ino->count)) {
                p_ino = autofs4_dentry_ino(dentry->d_parent);
@@ -874,7 +876,7 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp,
 static long autofs4_root_ioctl(struct file *filp,
                               unsigned int cmd, unsigned long arg)
 {
-       struct inode *inode = filp->f_dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
 }
 
@@ -882,7 +884,7 @@ static long autofs4_root_ioctl(struct file *filp,
 static long autofs4_root_compat_ioctl(struct file *filp,
                             unsigned int cmd, unsigned long arg)
 {
-       struct inode *inode = filp->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(filp);
        int ret;
 
        if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL)