All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [PATCH V2] ovl: Pass ovl_get_nlink() parameters in right order
Date: Tue, 28 Nov 2017 09:18:28 -0500	[thread overview]
Message-ID: <20171128141828.GA4101@redhat.com> (raw)
In-Reply-To: <CAOQ4uxhMyc3xcRHvbOq6W3KM2gzuUFKej7+p9NwO-XW1CMPpcw@mail.gmail.com>

On Tue, Nov 28, 2017 at 02:58:00PM +0200, Amir Goldstein wrote:
> On Mon, Nov 27, 2017 at 11:26 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> > On Mon, Nov 27, 2017 at 01:46:13PM -0500, Vivek Goyal wrote:
> >> Right now we seem to be passing index as "lowerdentry" and origin.dentry
> >> as "upperdentry". IIUC, we should pass these parameters in reversed order
> >> and this looks like a bug.
> >>
> >
> > Hi,
> >
> > Don't merge this patch yet. I think this breaks overlay/042 and does not
> > cleanup orphan index. Trying to debug it.
> >
> 
> Vivek,
> 
> The problem is with the test, not with your patch.
> I copied sanity check at end of test to verify that orphan index is cleaned
> on mount from test overlay/034, but there is a subtle difference between
> the 2 tests - with overlay/034 lower is hardlink from the start and therefore
> indexed from the first copy up and nlink accounted from the first copy up.
> with overlay/042, lower is not a hardlink to begin with, so the first copy up
> (at upper path /0) is a non-indexed broken hardlink, which is covering
> the lower /0 path that later becomes a hardlink.
> 
> At the end of test overlay/042, index is NOT cleaned because the
> accounted nlink is not 0, it is 1, because from the index perspective,
> it does not know that the upper path at /0 is covered by a non-indexed
> copy up.
> 
> The whole purpose of the trusted.overlay.nlink accounting is to account
> for the not-yet-copied-up lower hardlinks, so the index with the new data
> is not unlinked after unlinking all current upper hardlinks.
> 
> I wrote a new test to demonstrate this use case and demonstrate the
> implications the bug that you found has on end users:
> https://github.com/amir73il/xfstests/blob/overlayfs-devel/tests/overlay/047
> 
> I will fix test overlay/042.
> Thanks for reporting this breakage.

Hi Amir,

Thanks for the explanation. Good that it is a test issue and not patch
issue. I will repost the patch as V3. In last version, I forgot to cc
stable list.

Vivek

      reply	other threads:[~2017-11-28 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 18:46 [PATCH V2] ovl: Pass ovl_get_nlink() parameters in right order Vivek Goyal
2017-11-27 21:26 ` Vivek Goyal
2017-11-28 12:58   ` Amir Goldstein
2017-11-28 14:18     ` Vivek Goyal [this message]

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=20171128141828.GA4101@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=linux-unionfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.