* request for 4.4-stable: 21765194cecf2 ("ovl: Do d_type check only if work dir creation was successful")
@ 2018-08-23 10:14 SZ Lin (林上智)
0 siblings, 0 replies; only message in thread
From: SZ Lin (林上智) @ 2018-08-23 10:14 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, Vivek Goyal, Miklos Szeredi,
SZ Lin (林上智)
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
Hi Greg,
This patch is not marked for 4.4-stable, but it's already in 4.9 and 4.14 stable.
Please apply to 4.4-stable.
This patch fixed check machanism for d_type to avoid returning d_type not
supported even if underlying filesystem might be supporting it.
--
SZ Lin (林上智)
[-- Attachment #2: 0001-ovl-Do-d_type-check-only-if-work-dir-creation-was-su.patch --]
[-- Type: text/x-diff, Size: 1868 bytes --]
>From 27c05ebaf6ad418aaf3d142cfa20f8887b7eced4 Mon Sep 17 00:00:00 2001
From: Vivek Goyal <vgoyal@redhat.com>
Date: Fri, 20 May 2016 09:04:26 -0400
Subject: [PATCH] ovl: Do d_type check only if work dir creation was successful
commit 21765194cecf2e4514ad75244df459f188140a0f 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: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: SZ Lin (林上智) <sz.lin@moxa.com>
---
fs/overlayfs/super.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 2de4e3a7d6e7..fd21c5f74fba 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1058,16 +1058,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;
+ }
}
}
--
2.18.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-23 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23 10:14 request for 4.4-stable: 21765194cecf2 ("ovl: Do d_type check only if work dir creation was successful") SZ Lin (林上智)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).