Commit e08d6d41 authored by Vivek Goyal's avatar Vivek Goyal Committed by Kleber Sacilotto de Souza

ovl: Do d_type check only if work dir creation was successful

BugLink: https://bugs.launchpad.net/bugs/1792383

commit 21765194 upstream.

d_type check requires successful creation of workdir as iterates
through work dir and expects work dir to be present in it. If that's
not the case, this check will always return d_type not supported even
if underlying filesystem might be supporting it.

So don't do this check if work dir creation failed in previous step.
Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarSZ Lin (林上智) <sz.lin@moxa.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent daf935d5
......@@ -1145,16 +1145,19 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
/*
* Upper should support d_type, else whiteouts are visible.
* Given workdir and upper are on same fs, we can do
* iterate_dir() on workdir.
* iterate_dir() on workdir. This check requires successful
* creation of workdir in previous step.
*/
err = ovl_check_d_type_supported(&workpath);
if (err < 0)
goto out_put_workdir;
if (ufs->workdir) {
err = ovl_check_d_type_supported(&workpath);
if (err < 0)
goto out_put_workdir;
if (!err) {
pr_err("overlayfs: upper fs needs to support d_type.\n");
err = -EINVAL;
goto out_put_workdir;
if (!err) {
pr_err("overlayfs: upper fs needs to support d_type.\n");
err = -EINVAL;
goto out_put_workdir;
}
}
}
......
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