($INBOX_DIR/description missing)
 help / color / Atom feed
* [PATCH] ovl: fix lookup of indexed hardlinks with metacopy
@ 2020-07-15 13:38 Amir Goldstein
  2020-07-16 13:22 ` Vivek Goyal
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Goldstein @ 2020-07-15 13:38 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: Vivek Goyal, linux-unionfs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ovl: fix lookup of indexed hardlinks with metacopy
  2020-07-15 13:38 [PATCH] ovl: fix lookup of indexed hardlinks with metacopy Amir Goldstein
@ 2020-07-16 13:22 ` Vivek Goyal
  0 siblings, 0 replies; 2+ messages in thread
From: Vivek Goyal @ 2020-07-16 13:22 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Miklos Szeredi, linux-unionfs

On Wed, Jul 15, 2020 at 04:38:08PM +0300, Amir Goldstein wrote:
> 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>

Reviewed-by: Vivek Goyal <vgoyal@redhat.com>

Good catch Amir. Thanks.


> ---
> 
> 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?

No I don't. I will start testing this configuration. Actually I don't
have any automated setup and all the testing I do manually. I think
its time that atleast I have a script which runs bunch of tests
always.

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

Nice, I will check it out. Will be nice if this gets pushed to
xfstest tree.

Thanks
Vivek

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 13:38 [PATCH] ovl: fix lookup of indexed hardlinks with metacopy Amir Goldstein
2020-07-16 13:22 ` Vivek Goyal

($INBOX_DIR/description missing)

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-unionfs/0 linux-unionfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-unionfs linux-unionfs/ https://lore.kernel.org/linux-unionfs \
		linux-unionfs@vger.kernel.org
	public-inbox-index linux-unionfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-unionfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git