linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the pidfd tree with the xfs tree
@ 2021-01-25  6:14 Stephen Rothwell
  2021-01-27  0:24 ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-01-25  6:14 UTC (permalink / raw)
  To: Christian Brauner, Darrick J. Wong, David Chinner, linux-xfs
  Cc: Christian Brauner, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

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

  fs/xfs/xfs_inode.c

between commit:

  01ea173e103e ("xfs: fix up non-directory creation in SGID directories")

from the xfs tree and commit:

  f736d93d76d3 ("xfs: support idmapped mounts")

from the pidfd 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/xfs/xfs_inode.c
index e2a1db4cee43,95b7f2ba4e06..000000000000
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
  	inode->i_rdev = rdev;
  	ip->i_d.di_projid = prid;
  
 -	if (pip && XFS_INHERIT_GID(pip)) {
 -		inode->i_gid = VFS_I(pip)->i_gid;
 -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
 -			inode->i_mode |= S_ISGID;
 +	if (dir && !(dir->i_mode & S_ISGID) &&
 +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
 +		inode->i_uid = current_fsuid();
 +		inode->i_gid = dir->i_gid;
 +		inode->i_mode = mode;
  	} else {
- 		inode_init_owner(inode, dir, mode);
 -		inode->i_gid = fsgid_into_mnt(mnt_userns);
++		inode_init_owner(mnt_userns, inode, dir, mode);
  	}
  
  	/*

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

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

* Re: linux-next: manual merge of the pidfd tree with the xfs tree
  2021-01-25  6:14 linux-next: manual merge of the pidfd tree with the xfs tree Stephen Rothwell
@ 2021-01-27  0:24 ` Stephen Rothwell
  2021-01-27  3:11   ` Darrick J. Wong
  2021-02-14 21:42   ` Stephen Rothwell
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2021-01-27  0:24 UTC (permalink / raw)
  To: Christian Brauner, Darrick J. Wong, David Chinner, linux-xfs
  Cc: Christian Brauner, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

On Mon, 25 Jan 2021 17:14:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the pidfd tree got a conflict in:
> 
>   fs/xfs/xfs_inode.c
> 
> between commit:
> 
>   01ea173e103e ("xfs: fix up non-directory creation in SGID directories")
> 
> from the xfs tree and commit:
> 
>   f736d93d76d3 ("xfs: support idmapped mounts")
> 
> from the pidfd 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.
> 
> diff --cc fs/xfs/xfs_inode.c
> index e2a1db4cee43,95b7f2ba4e06..000000000000
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
>   	inode->i_rdev = rdev;
>   	ip->i_d.di_projid = prid;
>   
>  -	if (pip && XFS_INHERIT_GID(pip)) {
>  -		inode->i_gid = VFS_I(pip)->i_gid;
>  -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
>  -			inode->i_mode |= S_ISGID;
>  +	if (dir && !(dir->i_mode & S_ISGID) &&
>  +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
>  +		inode->i_uid = current_fsuid();

Looking a bit harder, I replaced the above line with
		inode->i_uid = fsuid_into_mnt(mnt_userns);

>  +		inode->i_gid = dir->i_gid;
>  +		inode->i_mode = mode;
>   	} else {
> - 		inode_init_owner(inode, dir, mode);
>  -		inode->i_gid = fsgid_into_mnt(mnt_userns);
> ++		inode_init_owner(mnt_userns, inode, dir, mode);
>   	}
>   
>   	/*

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the pidfd tree with the xfs tree
  2021-01-27  0:24 ` Stephen Rothwell
@ 2021-01-27  3:11   ` Darrick J. Wong
  2021-01-27  9:17     ` Christian Brauner
  2021-02-14 21:42   ` Stephen Rothwell
  1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2021-01-27  3:11 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christian Brauner, David Chinner, linux-xfs, Christian Brauner,
	Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

On Wed, Jan 27, 2021 at 11:24:41AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Mon, 25 Jan 2021 17:14:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the pidfd tree got a conflict in:
> > 
> >   fs/xfs/xfs_inode.c
> > 
> > between commit:
> > 
> >   01ea173e103e ("xfs: fix up non-directory creation in SGID directories")
> > 
> > from the xfs tree and commit:
> > 
> >   f736d93d76d3 ("xfs: support idmapped mounts")
> > 
> > from the pidfd 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.
> > 
> > diff --cc fs/xfs/xfs_inode.c
> > index e2a1db4cee43,95b7f2ba4e06..000000000000
> > --- a/fs/xfs/xfs_inode.c
> > +++ b/fs/xfs/xfs_inode.c
> > @@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
> >   	inode->i_rdev = rdev;
> >   	ip->i_d.di_projid = prid;
> >   
> >  -	if (pip && XFS_INHERIT_GID(pip)) {
> >  -		inode->i_gid = VFS_I(pip)->i_gid;
> >  -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
> >  -			inode->i_mode |= S_ISGID;
> >  +	if (dir && !(dir->i_mode & S_ISGID) &&
> >  +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
> >  +		inode->i_uid = current_fsuid();
> 
> Looking a bit harder, I replaced the above line with
> 		inode->i_uid = fsuid_into_mnt(mnt_userns);

I think that looks good, though Mr. Brauner is probably better equipped
to tell if that change is correct.

(He says watching kernel.org mail take nearly a day to come through...)

--D

> 
> >  +		inode->i_gid = dir->i_gid;
> >  +		inode->i_mode = mode;
> >   	} else {
> > - 		inode_init_owner(inode, dir, mode);
> >  -		inode->i_gid = fsgid_into_mnt(mnt_userns);
> > ++		inode_init_owner(mnt_userns, inode, dir, mode);
> >   	}
> >   
> >   	/*
> 
> -- 
> Cheers,
> Stephen Rothwell



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

* Re: linux-next: manual merge of the pidfd tree with the xfs tree
  2021-01-27  3:11   ` Darrick J. Wong
@ 2021-01-27  9:17     ` Christian Brauner
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Brauner @ 2021-01-27  9:17 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: Stephen Rothwell, Christian Brauner, David Chinner, linux-xfs,
	Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

On Tue, Jan 26, 2021 at 07:11:15PM -0800, Darrick J. Wong wrote:
> On Wed, Jan 27, 2021 at 11:24:41AM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > On Mon, 25 Jan 2021 17:14:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > Today's linux-next merge of the pidfd tree got a conflict in:
> > > 
> > >   fs/xfs/xfs_inode.c
> > > 
> > > between commit:
> > > 
> > >   01ea173e103e ("xfs: fix up non-directory creation in SGID directories")
> > > 
> > > from the xfs tree and commit:
> > > 
> > >   f736d93d76d3 ("xfs: support idmapped mounts")
> > > 
> > > from the pidfd 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.
> > > 
> > > diff --cc fs/xfs/xfs_inode.c
> > > index e2a1db4cee43,95b7f2ba4e06..000000000000
> > > --- a/fs/xfs/xfs_inode.c
> > > +++ b/fs/xfs/xfs_inode.c
> > > @@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
> > >   	inode->i_rdev = rdev;
> > >   	ip->i_d.di_projid = prid;
> > >   
> > >  -	if (pip && XFS_INHERIT_GID(pip)) {
> > >  -		inode->i_gid = VFS_I(pip)->i_gid;
> > >  -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
> > >  -			inode->i_mode |= S_ISGID;
> > >  +	if (dir && !(dir->i_mode & S_ISGID) &&
> > >  +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
> > >  +		inode->i_uid = current_fsuid();
> > 
> > Looking a bit harder, I replaced the above line with
> > 		inode->i_uid = fsuid_into_mnt(mnt_userns);
> 
> I think that looks good, though Mr. Brauner is probably better equipped
> to tell if that change is correct.

This is on top of the setgid fixup. Yes, this looks good! :)

I think what I'll do is to simply build -next for every release up until
the merge window and run the xfstests I added on the kernel. That should
reveal regressions very quickly.

> 
> (He says watching kernel.org mail take nearly a day to come through...)

Yeah, it had crazy delays (> 1 day). I chased down a few missing mails
from yesterday. Jon took that opportunity to make vger behave a little
better I believe, so delivery should be faster today, hopefully.

Christian

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

* Re: linux-next: manual merge of the pidfd tree with the xfs tree
  2021-01-27  0:24 ` Stephen Rothwell
  2021-01-27  3:11   ` Darrick J. Wong
@ 2021-02-14 21:42   ` Stephen Rothwell
  2021-02-21 22:53     ` Stephen Rothwell
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-02-14 21:42 UTC (permalink / raw)
  To: Christian Brauner, Darrick J. Wong, David Chinner, linux-xfs
  Cc: Christian Brauner, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

On Wed, 27 Jan 2021 11:24:41 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> On Mon, 25 Jan 2021 17:14:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the pidfd tree got a conflict in:
> > 
> >   fs/xfs/xfs_inode.c
> > 
> > between commit:
> > 
> >   01ea173e103e ("xfs: fix up non-directory creation in SGID directories")
> > 
> > from the xfs tree and commit:
> > 
> >   f736d93d76d3 ("xfs: support idmapped mounts")
> > 
> > from the pidfd 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.
> > 
> > diff --cc fs/xfs/xfs_inode.c
> > index e2a1db4cee43,95b7f2ba4e06..000000000000
> > --- a/fs/xfs/xfs_inode.c
> > +++ b/fs/xfs/xfs_inode.c
> > @@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
> >   	inode->i_rdev = rdev;
> >   	ip->i_d.di_projid = prid;
> >   
> >  -	if (pip && XFS_INHERIT_GID(pip)) {
> >  -		inode->i_gid = VFS_I(pip)->i_gid;
> >  -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
> >  -			inode->i_mode |= S_ISGID;
> >  +	if (dir && !(dir->i_mode & S_ISGID) &&
> >  +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
> >  +		inode->i_uid = current_fsuid();  
> 
> Looking a bit harder, I replaced the above line with
> 		inode->i_uid = fsuid_into_mnt(mnt_userns);
> 
> >  +		inode->i_gid = dir->i_gid;
> >  +		inode->i_mode = mode;
> >   	} else {
> > - 		inode_init_owner(inode, dir, mode);
> >  -		inode->i_gid = fsgid_into_mnt(mnt_userns);
> > ++		inode_init_owner(mnt_userns, inode, dir, mode);
> >   	}
> >   
> >   	/*  

With the merge window about to open, this is a reminder that this
conflict still exists.

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the pidfd tree with the xfs tree
  2021-02-14 21:42   ` Stephen Rothwell
@ 2021-02-21 22:53     ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2021-02-21 22:53 UTC (permalink / raw)
  To: Christian Brauner, linux-xfs
  Cc: Darrick J. Wong, David Chinner, Christian Brauner,
	Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

On Mon, 15 Feb 2021 08:42:43 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Wed, 27 Jan 2021 11:24:41 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > On Mon, 25 Jan 2021 17:14:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > >
> > > Today's linux-next merge of the pidfd tree got a conflict in:
> > > 
> > >   fs/xfs/xfs_inode.c
> > > 
> > > between commit:
> > > 
> > >   01ea173e103e ("xfs: fix up non-directory creation in SGID directories")
> > > 
> > > from the xfs tree and commit:
> > > 
> > >   f736d93d76d3 ("xfs: support idmapped mounts")
> > > 
> > > from the pidfd 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.
> > > 
> > > diff --cc fs/xfs/xfs_inode.c
> > > index e2a1db4cee43,95b7f2ba4e06..000000000000
> > > --- a/fs/xfs/xfs_inode.c
> > > +++ b/fs/xfs/xfs_inode.c
> > > @@@ -809,13 -810,13 +810,13 @@@ xfs_init_new_inode
> > >   	inode->i_rdev = rdev;
> > >   	ip->i_d.di_projid = prid;
> > >   
> > >  -	if (pip && XFS_INHERIT_GID(pip)) {
> > >  -		inode->i_gid = VFS_I(pip)->i_gid;
> > >  -		if ((VFS_I(pip)->i_mode & S_ISGID) && S_ISDIR(mode))
> > >  -			inode->i_mode |= S_ISGID;
> > >  +	if (dir && !(dir->i_mode & S_ISGID) &&
> > >  +	    (mp->m_flags & XFS_MOUNT_GRPID)) {
> > >  +		inode->i_uid = current_fsuid();    
> > 
> > Looking a bit harder, I replaced the above line with
> > 		inode->i_uid = fsuid_into_mnt(mnt_userns);
> >   
> > >  +		inode->i_gid = dir->i_gid;
> > >  +		inode->i_mode = mode;
> > >   	} else {
> > > - 		inode_init_owner(inode, dir, mode);
> > >  -		inode->i_gid = fsgid_into_mnt(mnt_userns);
> > > ++		inode_init_owner(mnt_userns, inode, dir, mode);
> > >   	}
> > >   
> > >   	/*    
> 
> With the merge window about to open, this is a reminder that this
> conflict still exists.

This is now a conflict between the pidfd tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

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

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

end of thread, other threads:[~2021-02-21 22:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25  6:14 linux-next: manual merge of the pidfd tree with the xfs tree Stephen Rothwell
2021-01-27  0:24 ` Stephen Rothwell
2021-01-27  3:11   ` Darrick J. Wong
2021-01-27  9:17     ` Christian Brauner
2021-02-14 21:42   ` Stephen Rothwell
2021-02-21 22:53     ` Stephen Rothwell

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