diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2016-05-20 09:04:26 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-05-27 10:18:56 +0200 |
commit | 21765194cecf2e4514ad75244df459f188140a0f (patch) | |
tree | c8a36248d274b2f9096d9fff4127506966c544de /fs | |
parent | 942fd803e6dfc64d32f2ae4f160b2986bc5897b8 (diff) | |
download | linux-stable-21765194cecf2e4514ad75244df459f188140a0f.tar.gz linux-stable-21765194cecf2e4514ad75244df459f188140a0f.tar.bz2 linux-stable-21765194cecf2e4514ad75244df459f188140a0f.zip |
ovl: Do d_type check only if work dir creation was successful
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: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/overlayfs/super.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index d659f766ceff..781e1d86d2ce 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1074,16 +1074,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; + } } } |