From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932533Ab3BNIe1 (ORCPT ); Thu, 14 Feb 2013 03:34:27 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:46645 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932311Ab3BNIeZ (ORCPT ); Thu, 14 Feb 2013 03:34:25 -0500 Date: Thu, 14 Feb 2013 00:34:17 -0800 From: Joel Becker To: "Eric W. Biederman" Cc: linux-fsdevel@vger.kernel.org, Linux Containers , linux-kernel@vger.kernel.org, "Serge E. Hallyn" , Mark Fasheh Subject: Re: [PATCH review 22/85] ocfs2: convert between kuids and kgids and DLM locks Message-ID: <20130214083416.GD18408@localhost> Mail-Followup-To: "Eric W. Biederman" , linux-fsdevel@vger.kernel.org, Linux Containers , linux-kernel@vger.kernel.org, "Serge E. Hallyn" , Mark Fasheh References: <87621w14vs.fsf@xmission.com> <1360777934-5663-1-git-send-email-ebiederm@xmission.com> <1360777934-5663-22-git-send-email-ebiederm@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1360777934-5663-22-git-send-email-ebiederm@xmission.com> X-Burt-Line: Trees are cool. X-Red-Smith: Ninety feet between bases is perhaps as close as man has ever come to perfection. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 13, 2013 at 09:51:11AM -0800, Eric W. Biederman wrote: > From: "Eric W. Biederman" > > Convert between uid and gids stored in the on the wire format of dlm > locks aka struct ocfs2_meta_lvb and kuids and kgids stored in > inode->i_uid and inode->i_gid. > > Cc: Mark Fasheh > Cc: Joel Becker > Signed-off-by: "Eric W. Biederman" > --- > fs/ocfs2/dlmglue.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c > index 4f7795f..f99af1c 100644 > --- a/fs/ocfs2/dlmglue.c > +++ b/fs/ocfs2/dlmglue.c > @@ -2045,8 +2045,8 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) > lvb->lvb_version = OCFS2_LVB_VERSION; > lvb->lvb_isize = cpu_to_be64(i_size_read(inode)); > lvb->lvb_iclusters = cpu_to_be32(oi->ip_clusters); > - lvb->lvb_iuid = cpu_to_be32(inode->i_uid); > - lvb->lvb_igid = cpu_to_be32(inode->i_gid); > + lvb->lvb_iuid = cpu_to_be32(i_uid_read(inode)); > + lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); > lvb->lvb_imode = cpu_to_be16(inode->i_mode); > lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); > lvb->lvb_iatime_packed = > @@ -2095,8 +2095,8 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) > else > inode->i_blocks = ocfs2_inode_sector_count(inode); > > - inode->i_uid = be32_to_cpu(lvb->lvb_iuid); > - inode->i_gid = be32_to_cpu(lvb->lvb_igid); > + i_uid_write(inode, be32_to_cpu(lvb->lvb_iuid)); > + i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); > inode->i_mode = be16_to_cpu(lvb->lvb_imode); > set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); > ocfs2_unpack_timespec(&inode->i_atime, What does this do if two machines with different user namespaces communicate. I think that things go very wrong. Perhaps right now, when ocfs2 is tied to init_user_namespace, we're OK. But as soon as two systems can be in different namespaces, we are broken. Joel > -- > 1.7.5.4 > -- "I think it would be a good idea." - Mahatma Ghandi, when asked what he thought of Western civilization http://www.jlbec.org/ jlbec@evilplan.org