aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-11 00:23:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:09 -0400
commitf9652e10c12b43d9bb957269745cf2fa5682fa92 (patch)
treefd358891b9778f7bdd8764163aa2029d01efcf9c /fs/namei.c
parent50cd2c577668a170750b15f9a88f022f681ce3c7 (diff)
allow build_open_flags() to return an error
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 1bc7b7582a66..402eda351d07 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2969,9 +2969,10 @@ out:
2969} 2969}
2970 2970
2971struct file *do_filp_open(int dfd, struct filename *pathname, 2971struct file *do_filp_open(int dfd, struct filename *pathname,
2972 const struct open_flags *op, int flags) 2972 const struct open_flags *op)
2973{ 2973{
2974 struct nameidata nd; 2974 struct nameidata nd;
2975 int flags = op->lookup_flags;
2975 struct file *filp; 2976 struct file *filp;
2976 2977
2977 filp = path_openat(dfd, pathname, &nd, op, flags | LOOKUP_RCU); 2978 filp = path_openat(dfd, pathname, &nd, op, flags | LOOKUP_RCU);
@@ -2983,17 +2984,16 @@ struct file *do_filp_open(int dfd, struct filename *pathname,
2983} 2984}
2984 2985
2985struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt, 2986struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
2986 const char *name, const struct open_flags *op, int flags) 2987 const char *name, const struct open_flags *op)
2987{ 2988{
2988 struct nameidata nd; 2989 struct nameidata nd;
2989 struct file *file; 2990 struct file *file;
2990 struct filename filename = { .name = name }; 2991 struct filename filename = { .name = name };
2992 int flags = op->lookup_flags | LOOKUP_ROOT;
2991 2993
2992 nd.root.mnt = mnt; 2994 nd.root.mnt = mnt;
2993 nd.root.dentry = dentry; 2995 nd.root.dentry = dentry;
2994 2996
2995 flags |= LOOKUP_ROOT;
2996
2997 if (dentry->d_inode->i_op->follow_link && op->intent & LOOKUP_OPEN) 2997 if (dentry->d_inode->i_op->follow_link && op->intent & LOOKUP_OPEN)
2998 return ERR_PTR(-ELOOP); 2998 return ERR_PTR(-ELOOP);
2999 2999