preparations for making unlock_mount() a __cleanup();
can't have path_put() inside mount_lock scope.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
static int do_loopback(struct path *path, const char *old_name,
int recurse)
{
- struct path old_path;
+ struct path old_path __free(path_put) = {};
struct mount *mnt = NULL, *parent;
struct pinned_mountpoint mp = {};
int err;
if (err)
return err;
- err = -EINVAL;
if (mnt_ns_loop(old_path.dentry))
- goto out;
+ return -EINVAL;
err = lock_mount(path, &mp);
if (err)
- goto out;
+ return err;
parent = real_mount(path->mnt);
if (!check_mnt(parent))
}
out2:
unlock_mount(&mp);
-out:
- path_put(&old_path);
return err;
}