Commit e5b811e3 authored by Al Viro's avatar Al Viro

drop bogus check in file_open_root()

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3f7036a0
...@@ -988,9 +988,6 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, ...@@ -988,9 +988,6 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
return ERR_PTR(err); return ERR_PTR(err);
if (flags & O_CREAT) if (flags & O_CREAT)
return ERR_PTR(-EINVAL); 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); return do_file_open_root(dentry, mnt, filename, &op);
} }
EXPORT_SYMBOL(file_open_root); EXPORT_SYMBOL(file_open_root);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment