stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ovl: Do d_type check only if work dir creation was successful" has been added to the 4.6-stable tree
@ 2016-07-25 20:32 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-07-25 20:32 UTC (permalink / raw)
  To: vgoyal, gregkh, mszeredi; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

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

to the 4.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ovl-do-d_type-check-only-if-work-dir-creation-was-successful.patch
and it can be found in the queue-4.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 21765194cecf2e4514ad75244df459f188140a0f Mon Sep 17 00:00:00 2001
From: Vivek Goyal <vgoyal@redhat.com>
Date: Fri, 20 May 2016 09:04:26 -0400
Subject: ovl: Do d_type check only if work dir creation was successful

From: Vivek Goyal <vgoyal@redhat.com>

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/overlayfs/super.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1064,16 +1064,19 @@ static int ovl_fill_super(struct super_b
 		/*
 		 * 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;
+			}
 		}
 	}
 


Patches currently in stable-queue which might be from vgoyal@redhat.com are

queue-4.6/ovl-warn-instead-of-error-if-d_type-is-not-supported.patch
queue-4.6/ovl-copy-up-underlying-inode-s-i_mode-to-overlay-inode.patch
queue-4.6/ovl-do-d_type-check-only-if-work-dir-creation-was-successful.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-25 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 20:32 Patch "ovl: Do d_type check only if work dir creation was successful" has been added to the 4.6-stable tree gregkh

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).