From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 6674C7F3F for ; Wed, 17 Jul 2013 16:42:16 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 497BE30404E for ; Wed, 17 Jul 2013 14:42:16 -0700 (PDT) Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) by cuda.sgi.com with ESMTP id 7Rc7SC1SfCwK3BQu (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 17 Jul 2013 14:42:15 -0700 (PDT) Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Jul 2013 17:42:14 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 8FF936E8028 for ; Wed, 17 Jul 2013 17:42:07 -0400 (EDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6HLgBDX099756 for ; Wed, 17 Jul 2013 17:42:12 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6HLgBTu012640 for ; Wed, 17 Jul 2013 15:42:11 -0600 Subject: Re: [PATCH] xfs: Initialize all quota inodes to be NULLFSINO From: Chandra Seetharaman In-Reply-To: <20130716002352.GA3920@dastard> References: <1373593665.20769.10.camel@chandra-dt.ibm.com> <20130713021349.GH3438@dastard> <1373928885.20769.42.camel@chandra-dt.ibm.com> <20130716002352.GA3920@dastard> Date: Wed, 17 Jul 2013 16:42:10 -0500 Message-ID: <1374097330.8941.12.camel@chandra-dt.ibm.com> Mime-Version: 1.0 Reply-To: sekharan@us.ibm.com List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: XFS mailing list On Tue, 2013-07-16 at 10:23 +1000, Dave Chinner wrote: > On Mon, Jul 15, 2013 at 05:54:45PM -0500, Chandra Seetharaman wrote: > > On Sat, 2013-07-13 at 12:13 +1000, Dave Chinner wrote: > > > On Thu, Jul 11, 2013 at 08:47:45PM -0500, Chandra Seetharaman wrote: > > > > > > > > mkfs doesn't initialize the quota inodes to NULLFSINO as it > > > > does for the other internal inodes. This leads to check for two > > > > values (0 and NULLFSINO) to make sure if a quota inode is > > > > valid. > > > > > > > > Solve that problem by initializing the values to NULLFSINO > > > > if they are 0. > > > > > > > > Note that these values are not written back to on-disk > > > > superblock unless some quota is enabled on the filesystem. > > > > > > > > Signed-off-by: Chandra Seetharaman > > > > --- > > > > fs/xfs/xfs_mount.c | 12 ++++++++++++ > > > > 1 files changed, 12 insertions(+), 0 deletions(-) > > > > > > > > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > > > > index 2b0ba35..8b95933 100644 > > > > --- a/fs/xfs/xfs_mount.c > > > > +++ b/fs/xfs/xfs_mount.c > > > > @@ -572,6 +572,18 @@ out_unwind: > > > > static void > > > > xfs_sb_quota_from_disk(struct xfs_sb *sbp) > > > > { > > > > + /* > > > > + * older mkfs doesn't initialize quota inodes to NULLFSINO, > > > > + * which leads to two values for a quota inode to be invalid: > > > > + * 0 and NULLFSINO. Fix it. > > > > + */ > > > > + if (sbp->sb_uquotino == 0) > > > > + sbp->sb_uquotino = NULLFSINO; > > > > + if (sbp->sb_gquotino == 0) > > > > + sbp->sb_gquotino = NULLFSINO; > > > > + if (sbp->sb_pquotino == 0) > > > > + sbp->sb_pquotino = NULLFSINO; > > > > > > There coment needs to point out that this is changing the in-memory > > > superblock value right here, so we don't need to make changing > > > sb_pquotino dependent on the superblock having support for this > > > feature. > > > > But, we are not just changing just for sb_pquotino, right ? > > Sure, but those other two fields are always present in the > superblock... > > > Since we are changing all the fields independent of superblock > > supporting sb_pquotino, I thought the comment should be generic. > > So why is it safe to modify this when sb_pquotino isn't valid in the > superblock (i.e. v4 superblock) and the only valid on-disk value for > an unused section of the superblock is zero? > > That's what the comment needs to explain. How about this: /* * older mkfs doesn't initialize quota inodes to NULLFSINO * This leads to in-core values having two different values * for a quota inode to be invalid: 0 and NULLFSINO. * Change it to a single value NULLFSINO. * * Note that this change affect only the in-core values. * These values are not written back to disk unless any * quota information is written to the disk. Even in that * case, sb_pquotino field is not written to disk unless * the superblock supports pquotino. */ > Cheers, > > Dave. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs