All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: update incore per-AG inode count
Date: Mon, 11 Jun 2018 08:14:39 -0400	[thread overview]
Message-ID: <20180611121438.GA2812@bfoster> (raw)
In-Reply-To: <20180609022653.GS25007@magnolia>

On Fri, Jun 08, 2018 at 07:26:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> For whatever reason we never actually update pagi_count (the in-core
> perag inode count) when we allocate or free inode chunks.  Online scrub
> is going to use it, so we need to fix the accounting.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Interesting, I guess it hasn't been a problem because the value is only
used in a particular mount scenario right after it is initialized from
disk. Anyways:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_ialloc.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index 3f551eb29157..a64f71b614cc 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -897,6 +897,7 @@ xfs_ialloc_ag_alloc(
>  	be32_add_cpu(&agi->agi_freecount, newlen);
>  	pag = xfs_perag_get(args.mp, agno);
>  	pag->pagi_freecount += newlen;
> +	pag->pagi_count += newlen;
>  	xfs_perag_put(pag);
>  	agi->agi_newino = cpu_to_be32(newino);
>  
> @@ -1991,6 +1992,7 @@ xfs_difree_inobt(
>  		xfs_ialloc_log_agi(tp, agbp, XFS_AGI_COUNT | XFS_AGI_FREECOUNT);
>  		pag = xfs_perag_get(mp, agno);
>  		pag->pagi_freecount -= ilen - 1;
> +		pag->pagi_count -= ilen;
>  		xfs_perag_put(pag);
>  		xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen);
>  		xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1));
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2018-06-11 12:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-09  2:26 [PATCH] xfs: update incore per-AG inode count Darrick J. Wong
2018-06-11 12:14 ` Brian Foster [this message]

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=20180611121438.GA2812@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /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.