summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/copy_up.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-05-16 16:51:25 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2018-05-31 11:06:11 +0200
commit95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0 (patch)
treeda1fadaf2b5e9c96cab3225e596641595f0600ad /fs/overlayfs/copy_up.c
parentovl: struct cattr cleanups (diff)
downloadlinux-95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0.tar.xz
linux-95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0.zip
ovl: return dentry from ovl_create_real()
Al Viro suggested to simplify callers of ovl_create_real() by returning the created dentry (or ERR_PTR) from ovl_create_real(). Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/copy_up.c')
-rw-r--r--fs/overlayfs/copy_up.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index 5f4c78b1bbeb..d3e9c1eeb7a4 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -502,19 +502,12 @@ static int ovl_get_tmpfile(struct ovl_copy_up_ctx *c, struct dentry **tempp)
if (c->tmpfile) {
temp = ovl_do_tmpfile(c->workdir, c->stat.mode);
- if (IS_ERR(temp))
- goto temp_err;
} else {
- temp = ovl_lookup_temp(c->workdir);
- if (IS_ERR(temp))
- goto temp_err;
-
- err = ovl_create_real(d_inode(c->workdir), temp, &cattr);
- if (err) {
- dput(temp);
- goto out;
- }
+ temp = ovl_create_real(d_inode(c->workdir),
+ ovl_lookup_temp(c->workdir), &cattr);
}
+ if (IS_ERR(temp))
+ goto temp_err;
err = 0;
*tempp = temp;
out: