All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: XFS mailing list <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs: Initialize all quota inodes to be NULLFSINO
Date: Sat, 13 Jul 2013 12:13:50 +1000	[thread overview]
Message-ID: <20130713021349.GH3438@dastard> (raw)
In-Reply-To: <1373593665.20769.10.camel@chandra-dt.ibm.com>

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 <sekharan@us.ibm.com>
> ---
>  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.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2013-07-13  2:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12  1:47 [PATCH] xfs: Initialize all quota inodes to be NULLFSINO Chandra Seetharaman
2013-07-12 14:27 ` Carlos Maiolino
2013-07-12 14:50   ` Chandra Seetharaman
2013-07-13  2:13 ` Dave Chinner [this message]
2013-07-15 22:54   ` Chandra Seetharaman
2013-07-16  0:23     ` Dave Chinner
2013-07-17 21:42       ` Chandra Seetharaman
2013-07-18  3:43         ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130713021349.GH3438@dastard \
    --to=david@fromorbit.com \
    --cc=sekharan@us.ibm.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.