From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v3 16/18] xfs: use actual inode count for sparse records in bulkstat/inumbers
Date: Mon, 9 Feb 2015 09:29:19 +1100 [thread overview]
Message-ID: <20150208222919.GD4251@dastard> (raw)
In-Reply-To: <1423252385-3063-17-git-send-email-bfoster@redhat.com>
On Fri, Feb 06, 2015 at 02:53:03PM -0500, Brian Foster wrote:
> The bulkstat and inumbers mechanisms make the assumption that inode
> records consist of a full 64 inode chunk in several places. For example,
> this is used to track how many inodes have been processed overall as
> well as to determine whether a record has allocated inodes that must be
> handled.
>
> This assumption is invalid for sparse inode records. While sparse inodes
> will be marked as free in the ir_free mask, they are not accounted as
> free in ir_freecount because they cannot be allocated. Therefore,
> ir_freecount may be less than 64 inodes in an inode record for which all
> physically allocated inodes are free (and in turn ir_freecount < 64 does
> not signify that the record has allocated inodes).
>
> Create the xfs_inobt_count() helper to calculate the total number of
> physically allocated inodes based on the holemask. Use the helper in
> xfs_bulkstat() and xfs_inumbers() instead of the fixed
> XFS_INODE_PER_CHUNK value to ensure correct accounting in the event of
> sparse inode records.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
This should be moved to early in the patchset as a preparation
patch. i.e. xfs_inobt_issparse() can be introduced without any other
dependencies on the sparse inode changes, and then this factoring
can be added before any of the actual sparse inode changes.
That way anywhere that uses the number of allocated inodes in a
chunk will be correct for sparse inodes even before sparse inode
support is added...
> ---
> fs/xfs/libxfs/xfs_ialloc.c | 16 ++++++++++++++++
> fs/xfs/libxfs/xfs_ialloc.h | 5 +++++
> fs/xfs/xfs_itable.c | 14 ++++++++++----
> 3 files changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index c104ee5..4d151ed 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -1207,6 +1207,22 @@ xfs_inobt_first_free_inode(
> }
>
> /*
> + * Calculate the real count of inodes in a chunk.
> + */
> +int
> +xfs_inobt_count(
> + struct xfs_mount *mp,
> + struct xfs_inobt_rec_incore *rec)
> +{
> + ASSERT(!xfs_inobt_rec_check_count(mp, rec));
> +
> + if (!xfs_inobt_issparse(rec->ir_holemask))
> + return XFS_INODES_PER_CHUNK;
> +
> + return rec->ir_count;
> +}
This btree record state check should probably be added to
xfs_ialloc_btree.c.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-02-08 22:39 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 19:52 [PATCH v3 00/18] xfs: sparse inode chunks Brian Foster
2015-02-06 19:52 ` [PATCH v3 01/18] xfs: add sparse inode chunk alignment superblock field Brian Foster
2015-02-06 22:40 ` Dave Chinner
2015-02-08 16:04 ` Brian Foster
2015-02-08 21:43 ` Dave Chinner
2015-02-06 19:52 ` [PATCH v3 02/18] xfs: use sparse chunk alignment for min. inode allocation requirement Brian Foster
2015-02-06 19:52 ` [PATCH v3 03/18] xfs: sparse inode chunks feature helpers and mount requirements Brian Foster
2015-02-06 22:54 ` Dave Chinner
2015-02-06 19:52 ` [PATCH v3 04/18] xfs: introduce inode record hole mask for sparse inode chunks Brian Foster
2015-02-06 23:16 ` Dave Chinner
2015-02-08 16:06 ` Brian Foster
2015-02-08 21:57 ` Dave Chinner
2015-02-09 15:15 ` Brian Foster
2015-02-09 21:48 ` Dave Chinner
2015-02-10 12:58 ` Brian Foster
2015-02-06 19:52 ` [PATCH v3 05/18] xfs: create macros/helpers for dealing with " Brian Foster
2015-02-06 19:52 ` [PATCH v3 06/18] xfs: pass inode count through ordered icreate log item Brian Foster
2015-02-06 19:52 ` [PATCH v3 07/18] xfs: handle sparse inode chunks in icreate log recovery Brian Foster
2015-02-06 23:19 ` Dave Chinner
2015-02-08 16:06 ` Brian Foster
2015-02-06 19:52 ` [PATCH v3 08/18] xfs: helpers to convert holemask to/from generic bitmap Brian Foster
2015-02-08 23:54 ` Dave Chinner
2015-02-09 15:15 ` Brian Foster
2015-02-06 19:52 ` [PATCH v3 09/18] xfs: support min/max agbno args in block allocator Brian Foster
2015-02-09 0:01 ` Dave Chinner
2015-02-06 19:52 ` [PATCH v3 10/18] xfs: allocate sparse inode chunks on full chunk allocation failure Brian Foster
2015-02-09 1:25 ` Dave Chinner
2015-02-09 15:20 ` Brian Foster
2015-02-06 19:52 ` [PATCH v3 11/18] xfs: randomly do sparse inode allocations in DEBUG mode Brian Foster
2015-02-08 23:02 ` Dave Chinner
2015-02-09 15:20 ` Brian Foster
2015-02-06 19:52 ` [PATCH v3 12/18] xfs: filter out sparse regions from individual inode allocation Brian Foster
2015-02-08 22:49 ` Dave Chinner
2015-02-06 19:53 ` [PATCH v3 13/18] xfs: update free inode record logic to support sparse inode records Brian Foster
2015-02-08 22:33 ` Dave Chinner
2015-02-06 19:53 ` [PATCH v3 14/18] xfs: only free allocated regions of inode chunks Brian Foster
2015-02-06 19:53 ` [PATCH v3 15/18] xfs: skip unallocated regions of inode chunks in xfs_ifree_cluster() Brian Foster
2015-02-06 19:53 ` [PATCH v3 16/18] xfs: use actual inode count for sparse records in bulkstat/inumbers Brian Foster
2015-02-08 22:29 ` Dave Chinner [this message]
2015-02-06 19:53 ` [PATCH v3 17/18] xfs: add fs geometry bit for sparse inode chunks Brian Foster
2015-02-06 19:53 ` [PATCH v3 18/18] xfs: enable sparse inode chunks for v5 superblocks Brian Foster
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=20150208222919.GD4251@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox