public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Vivek Goyal <vgoyal@redhat.com>, linux-unionfs@vger.kernel.org
Subject: [PATCH] ovl: fix lookup of indexed hardlinks with metacopy
Date: Wed, 15 Jul 2020 16:38:08 +0300	[thread overview]
Message-ID: <20200715133808.7146-1-amir73il@gmail.com> (raw)

We recently moved setting inode flag OVL_UPPERDATA to ovl_lookup().

When looking up an overlay dentry, upperdentry may be found by index
and not by name.  In that case, we fail to read the metacopy xattr
and falsly set the OVL_UPPERDATA on the overlay inode.

This caused a regression in xfstest overlay/033 when run with
OVERLAY_MOUNT_OPTIONS="-o metacopy=on".

Fixes: 28166ab3c875 ("ovl: initialize OVL_UPPERDATA in ovl_lookup()")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Miklos,

I just ran xfstests -g overlay/quick tests with metacopy enabled
and one test failed.

Vivek,

Do you by any chance run this sort of test regularly?

You have asked about running unionmount tests with metacopy before.
I just pushed a commit to my xfstests 'unionmount' branch:
  7859f22b ovl: test unionmount tests with metacopy

It allows you to run xfstests -g overlay/union with
OVERLAY_MOUNT_OPTIONS="-o metacopy=on", to excercise all the unionmount
test configurations I created with metacopy enabled.

Maybe not so surprising that the sub-group overlay/union.nested tests
fail with metacopy enabled. This is just a test setup bug and I pushed
a fix commit to unionmount overlayfs-devel branch to fix it.

Thanks,
Amir.

 fs/overlayfs/namei.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 3566282a9199..0c5a624600c1 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1073,6 +1073,10 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
 			upperredirect = NULL;
 			goto out_free_oe;
 		}
+		err = ovl_check_metacopy_xattr(upperdentry);
+		if (err < 0)
+			goto out_free_oe;
+		uppermetacopy = err;
 	}
 
 	if (upperdentry || ctr) {
-- 
2.17.1


             reply	other threads:[~2020-07-15 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 13:38 Amir Goldstein [this message]
2020-07-16 13:22 ` [PATCH] ovl: fix lookup of indexed hardlinks with metacopy Vivek Goyal

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=20200715133808.7146-1-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=vgoyal@redhat.com \
    /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