linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: overlayfs: BUG in ovl_whiteout
Date: Wed, 6 Oct 2010 13:29:40 +0100	[thread overview]
Message-ID: <20101006122940.GC19733@agent57> (raw)
In-Reply-To: <E1P2rSX-0002hz-Lj@pomaz-ex.szeredi.hu>

On Mon, Oct 04, 2010 at 10:16:29PM +0200, Miklos Szeredi wrote:
> 
> OK, my guess is that it's a 'rename to self' which was not properly
> implemented.
> 
> Does the following patch make a difference?

That one panic'd immediatly.  Seems that we can have missmatched lowers
as well.  I applied the below over the top, and that seems to pass
testing without tripping the WARN_ON.

-apw

commit 03375858c62f617846b5dc4968fe8178eda51a7c
Author: Andy Whitcroft <apw@canonical.com>
Date:   Tue Oct 5 14:54:08 2010 +0100

    overlayfs: handle missing lower inodes in ovl_is_same_inode
    
    Signed-off-by: Andy Whitcroft <apw@canonical.com>

diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
index c10cc7b..f596222 100644
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -1964,19 +1964,25 @@ static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
 
 static bool ovl_is_same_inode(struct dentry *d1, struct dentry *d2)
 {
-	struct dentry *upperd1;
-	struct dentry *upperd2;
+	struct dentry *od1;
+	struct dentry *od2;
 
-	upperd1 = ovl_dentry_upper(d1);
-	upperd2 = ovl_dentry_upper(d2);
+	od1 = ovl_dentry_upper(d1);
+	od2 = ovl_dentry_upper(d2);
 
-	if (upperd1 && upperd2)
-		return vfs_is_same_inode(upperd1, upperd2);
+	if (od1 && od2)
+		return vfs_is_same_inode(od1, od2);
 
-	if (upperd1 || upperd2)
+	if (od1 || od2)
 		return false;
 
-	return vfs_is_same_inode(ovl_dentry_lower(d1), ovl_dentry_lower(d2));
+	od1 = ovl_dentry_lower(d1);
+	od2 = ovl_dentry_lower(d2);
+
+	if (od1 && od2)
+		return vfs_is_same_inode(od1, od2);
+
+	return false;
 }
 
 static const struct super_operations ovl_super_operations = {

  reply	other threads:[~2010-10-06 12:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 18:07 overlayfs: BUG in ovl_whiteout Andy Whitcroft
2010-10-04  9:23 ` Miklos Szeredi
2010-10-04 17:33   ` Andy Whitcroft
2010-10-04 20:16     ` Miklos Szeredi
2010-10-06 12:29       ` Andy Whitcroft [this message]
2010-10-06 16:51         ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101006122940.GC19733@agent57 \
    --to=apw@canonical.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).