ovl: base tmpfile in workdir too
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:18 +0000 (22:03 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:18 +0000 (22:03 +0200)
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c

index 81b9a44916a069e266094a8d79e63bfa4886a19e..1264f243404725004ce57850e99d5b99dfe44239 100644 (file)
@@ -345,8 +345,7 @@ static int ovl_install_temp(struct dentry *workdir, struct dentry *upperdir,
        return err;
 }
 
-static int ovl_get_tmpfile(struct dentry *workdir, struct dentry *upperdir,
-                          struct dentry *dentry,
+static int ovl_get_tmpfile(struct dentry *workdir, struct dentry *dentry,
                           struct kstat *stat, const char *link, bool tmpfile,
                           struct dentry **tempp)
 {
@@ -369,7 +368,7 @@ static int ovl_get_tmpfile(struct dentry *workdir, struct dentry *upperdir,
                old_creds = override_creds(new_creds);
 
        if (tmpfile) {
-               temp = ovl_do_tmpfile(upperdir, stat->mode);
+               temp = ovl_do_tmpfile(workdir, stat->mode);
                if (IS_ERR(temp))
                        goto temp_err;
        } else {
@@ -453,8 +452,7 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
        struct dentry *temp = NULL;
        int err;
 
-       err = ovl_get_tmpfile(workdir, upperdir, dentry, stat, link, tmpfile,
-                             &temp);
+       err = ovl_get_tmpfile(workdir, dentry, stat, link, tmpfile, &temp);
        if (err)
                goto out;