public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs tree with the overlayfs-fixes tree
@ 2023-12-19 23:56 Stephen Rothwell
  2023-12-20  3:21 ` Amir Goldstein
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2023-12-19 23:56 UTC (permalink / raw)
  To: Al Viro, Miklos Szeredi, Amir Goldstein
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]

Hi all,

Today's linux-next merge of the vfs tree got a conflict in:

  fs/overlayfs/copy_up.c

between commit:

  413ba91089c7 ("ovl: fix dentry reference leak after changes to underlying layers")

from the overlayfs-fixes tree and commit:

  a8b0026847b8 ("rename(): avoid a deadlock in the case of parents having no common ancestor")

from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/overlayfs/copy_up.c
index 696478f09cc1,e44dc5f66161..000000000000
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@@ -779,13 -757,14 +779,15 @@@ static int ovl_copy_up_workdir(struct o
  	 * lock ordering with sb_writers, which shouldn't be held when calling
  	 * ovl_copy_up_data(), so lock workdir and destdir and make sure that
  	 * temp wasn't moved before copy up completion or cleanup.
 -	 * If temp was moved, abort without the cleanup.
  	 */
  	ovl_start_write(c->dentry);
- 	if (lock_rename(c->workdir, c->destdir) != NULL ||
- 	    temp->d_parent != c->workdir) {
+ 	trap = lock_rename(c->workdir, c->destdir);
+ 	if (trap || temp->d_parent != c->workdir) {
 +		/* temp or workdir moved underneath us? abort without cleanup */
 +		dput(temp);
  		err = -EIO;
+ 		if (IS_ERR(trap))
+ 			goto out;
  		goto unlock;
  	} else if (err) {
  		goto cleanup;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the vfs tree with the overlayfs-fixes tree
  2023-12-19 23:56 linux-next: manual merge of the vfs tree with the overlayfs-fixes tree Stephen Rothwell
@ 2023-12-20  3:21 ` Amir Goldstein
  0 siblings, 0 replies; 2+ messages in thread
From: Amir Goldstein @ 2023-12-20  3:21 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Al Viro, Miklos Szeredi, Linux Kernel Mailing List,
	Linux Next Mailing List

On Wed, Dec 20, 2023 at 1:56 AM Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the vfs tree got a conflict in:
>
>   fs/overlayfs/copy_up.c
>
> between commit:
>
>   413ba91089c7 ("ovl: fix dentry reference leak after changes to underlying layers")
>
> from the overlayfs-fixes tree and commit:
>
>   a8b0026847b8 ("rename(): avoid a deadlock in the case of parents having no common ancestor")
>
> from the vfs tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>

You solved it correctly, but anyway, ovl-fixes is for v6.7-rc7 and I plan
to send a PR for it soon.

I did try to give Al a heads up:
https://lore.kernel.org/linux-unionfs/CAOQ4uxi+4-jyNY6jzNt1wG5xcYSZiSfU0AtCWtF71PSW160zRw@mail.gmail.com/

Thanks,
Amir.

>
> diff --cc fs/overlayfs/copy_up.c
> index 696478f09cc1,e44dc5f66161..000000000000
> --- a/fs/overlayfs/copy_up.c
> +++ b/fs/overlayfs/copy_up.c
> @@@ -779,13 -757,14 +779,15 @@@ static int ovl_copy_up_workdir(struct o
>          * lock ordering with sb_writers, which shouldn't be held when calling
>          * ovl_copy_up_data(), so lock workdir and destdir and make sure that
>          * temp wasn't moved before copy up completion or cleanup.
>  -       * If temp was moved, abort without the cleanup.
>          */
>         ovl_start_write(c->dentry);
> -       if (lock_rename(c->workdir, c->destdir) != NULL ||
> -           temp->d_parent != c->workdir) {
> +       trap = lock_rename(c->workdir, c->destdir);
> +       if (trap || temp->d_parent != c->workdir) {
>  +              /* temp or workdir moved underneath us? abort without cleanup */
>  +              dput(temp);
>                 err = -EIO;
> +               if (IS_ERR(trap))
> +                       goto out;
>                 goto unlock;
>         } else if (err) {
>                 goto cleanup;

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

end of thread, other threads:[~2023-12-20  3:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 23:56 linux-next: manual merge of the vfs tree with the overlayfs-fixes tree Stephen Rothwell
2023-12-20  3:21 ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox