Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp511480pxb; Wed, 27 Jan 2021 13:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ6nkiZFvBXbAmH/U3M9uhp4KcpyQeG6XxyeXH8z11IUkEu7uTqrbn2wQBLQVTa4IgOVpQ X-Received: by 2002:aa7:c6cc:: with SMTP id b12mr10674340eds.67.1611782864274; Wed, 27 Jan 2021 13:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611782864; cv=none; d=google.com; s=arc-20160816; b=QO7R/yet4OszVIY1r+laQysvnWArYLpTqsuYrazy5IAqmnN2N/7IErYsl0omLor+E9 AZcUpX0+LXFh7E2WjfERNsTq+1OtN/k6ulWeO5FFgETGHZn8KxzDSXgS37xx8Kyf7M8i vzRkG8Hz+Ec0FQB0roIGVdIRnrqG9FkiRUIwWKkL4tPDsmGiPiOqtaywfuFsMiSfTPrH PwzjXDA54/mX7uDs/dqg8P7K3GL4mQnvOXBiA+j4137tw3XJ9nnG2YbWahP89UU36wb9 RxSnwDo4R3NYubKtONZtUgjezvacLR30SCMnxxBdtIGtVvtcMjZTy+hWQOjH5j11ZPzR H1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GXsfxu+EpjSPMQL/VG7wiw3OiXDLjBORQNbBKZADX+8=; b=IsTw3WyEgekHJbIt5+9tX3Ur1xz8AG+b6Zc5rHy61Z4XcnDeYp87DkITKdxDrW6Pz3 hOMuye0E/L2V+z44fGQfDPCaOhUTPsg8IEPRoYp0DSBz5if28v9Eqe70ol2XSiMgANqE 34j5QylzMIEva9x6Jl8Xl6ksPObiiOl29mgoilTRY3X+3NklKQBBDTRIlnru34jRA9Jy 1j/slRtgggAsmYTlPjdIbqeSi8LdihmI0obE66D0pZGtD5ILUx4H1HyoeBFYFvcYZapM 5gZZ40KbnmUtDw5JnxguMzrk4TsMxHtxnAQkMaZsIzLyEEnEB4Rs4Dt4wBLX/sWSDJOh O2Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ganhP9Mp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si1347208ejr.715.2021.01.27.13.27.18; Wed, 27 Jan 2021 13:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ganhP9Mp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbhA0Gen (ORCPT + 99 others); Wed, 27 Jan 2021 01:34:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:59076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233787AbhA0DMh (ORCPT ); Tue, 26 Jan 2021 22:12:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24CB220639; Wed, 27 Jan 2021 03:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611717076; bh=04pxKoswdp9eDCNzSWVd+jkXEOIvxj4syJjvxYEICZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ganhP9MpbbTL3psKQAMtwInaoysHgwc/+Ir47W+y+LgJLjEGbiOpUAU7dQoQnLqqV PCuG0bZOABdz1suOtV2xvnP0Bu78f/yaf8NACa18au+jNXHPcerrSDrQfP3LZ1dc7C 9yP2RN67QouPQa4b/L2tJ1ajh3nDWfN7TiBeies3qeXVxIKdeop9BE3mi+3vqByb5Z JKxYSNJlRWjYslQ5PLHJzXdQYWkXYG5IWTIH8/XC+BfDKBdQOb6U0tCSYUrBjfXZAU nQB8zRC2bh0g1yFVpiJozsU9oGVdYUp/vxw5mOGRCPdgc4fYUUKGv2jSn4oEKDMeb3 e6laIdrmOD6VQ== Date: Tue, 26 Jan 2021 19:11:15 -0800 From: "Darrick J. Wong" To: Stephen Rothwell Cc: Christian Brauner , David Chinner , linux-xfs@vger.kernel.org, Christian Brauner , Christoph Hellwig , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: manual merge of the pidfd tree with the xfs tree Message-ID: <20210127031115.GA7695@magnolia> References: <20210125171414.41ed957a@canb.auug.org.au> <20210127112441.1d07c1d4@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210127112441.1d07c1d4@canb.auug.org.au> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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