drop bogus check in file_open_root()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Mar 2015 03:36:51 +0000 (23:36 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:24:32 +0000 (22:24 -0400)
For one thing, LOOKUP_DIRECTORY will be dealt with in do_last().
For another, name can be an empty string, but not NULL - no callers
pass that and it would oops immediately if they would.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/open.c

index 33f9cbf2610b39498d416cb8c142fb5ebe4cc790..ebcc7df0c9b66374d5c1b9abcd72ee9fb4757b30 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -988,9 +988,6 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
                return ERR_PTR(err);
        if (flags & O_CREAT)
                return ERR_PTR(-EINVAL);
-       if (!filename && (flags & O_DIRECTORY))
-               if (!dentry->d_inode->i_op->lookup)
-                       return ERR_PTR(-ENOTDIR);
        return do_file_open_root(dentry, mnt, filename, &op);
 }
 EXPORT_SYMBOL(file_open_root);