From: "Darrick J. Wong" <djwong@kernel.org>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH V5 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively
Date: Mon, 24 Jan 2022 16:32:05 -0800 [thread overview]
Message-ID: <20220125003205.GW13540@magnolia> (raw)
In-Reply-To: <20220121051857.221105-7-chandan.babu@oracle.com>
On Fri, Jan 21, 2022 at 10:48:47AM +0530, Chandan Babu R wrote:
> A future commit will introduce a 64-bit on-disk data extent counter and a
> 32-bit on-disk attr extent counter. This commit promotes xfs_extnum_t and
> xfs_aextnum_t to 64 and 32-bits in order to correctly handle in-core versions
> of these quantities.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Looks good now,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/libxfs/xfs_bmap.c | 6 +++---
> fs/xfs/libxfs/xfs_inode_fork.c | 2 +-
> fs/xfs/libxfs/xfs_inode_fork.h | 2 +-
> fs/xfs/libxfs/xfs_types.h | 4 ++--
> fs/xfs/xfs_inode.c | 4 ++--
> fs/xfs/xfs_trace.h | 2 +-
> 6 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 6a0da0a2b3fd..6cc7817ff425 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -52,9 +52,9 @@ xfs_bmap_compute_maxlevels(
> xfs_mount_t *mp, /* file system mount structure */
> int whichfork) /* data or attr fork */
> {
> + xfs_extnum_t maxleafents; /* max leaf entries possible */
> int level; /* btree level */
> uint maxblocks; /* max blocks at this level */
> - xfs_extnum_t maxleafents; /* max leaf entries possible */
> int maxrootrecs; /* max records in root block */
> int minleafrecs; /* min records in leaf block */
> int minnoderecs; /* min records in node block */
> @@ -83,7 +83,7 @@ xfs_bmap_compute_maxlevels(
> maxrootrecs = xfs_bmdr_maxrecs(sz, 0);
> minleafrecs = mp->m_bmap_dmnr[0];
> minnoderecs = mp->m_bmap_dmnr[1];
> - maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs;
> + maxblocks = howmany_64(maxleafents, minleafrecs);
> for (level = 1; maxblocks > 1; level++) {
> if (maxblocks <= maxrootrecs)
> maxblocks = 1;
> @@ -467,7 +467,7 @@ xfs_bmap_check_leaf_extents(
> if (bp_release)
> xfs_trans_brelse(NULL, bp);
> error_norelse:
> - xfs_warn(mp, "%s: BAD after btree leaves for %d extents",
> + xfs_warn(mp, "%s: BAD after btree leaves for %llu extents",
> __func__, i);
> xfs_err(mp, "%s: CORRUPTED BTREE OR SOMETHING", __func__);
> xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
> index 829739e249b6..ce690abe5dce 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.c
> +++ b/fs/xfs/libxfs/xfs_inode_fork.c
> @@ -117,7 +117,7 @@ xfs_iformat_extents(
> * we just bail out rather than crash in kmem_alloc() or memcpy() below.
> */
> if (unlikely(size < 0 || size > XFS_DFORK_SIZE(dip, mp, whichfork))) {
> - xfs_warn(ip->i_mount, "corrupt inode %Lu ((a)extents = %d).",
> + xfs_warn(ip->i_mount, "corrupt inode %llu ((a)extents = %llu).",
> (unsigned long long) ip->i_ino, nex);
> xfs_inode_verifier_error(ip, -EFSCORRUPTED,
> "xfs_iformat_extents(1)", dip, sizeof(*dip),
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
> index 7ed2ecb51bca..4a8b77d425df 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.h
> +++ b/fs/xfs/libxfs/xfs_inode_fork.h
> @@ -21,9 +21,9 @@ struct xfs_ifork {
> void *if_root; /* extent tree root */
> char *if_data; /* inline file data */
> } if_u1;
> + xfs_extnum_t if_nextents; /* # of extents in this fork */
> short if_broot_bytes; /* bytes allocated for root */
> int8_t if_format; /* format of this fork */
> - xfs_extnum_t if_nextents; /* # of extents in this fork */
> };
>
> /*
> diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
> index 794a54cbd0de..373f64a492a4 100644
> --- a/fs/xfs/libxfs/xfs_types.h
> +++ b/fs/xfs/libxfs/xfs_types.h
> @@ -12,8 +12,8 @@ typedef uint32_t xfs_agblock_t; /* blockno in alloc. group */
> typedef uint32_t xfs_agino_t; /* inode # within allocation grp */
> typedef uint32_t xfs_extlen_t; /* extent length in blocks */
> typedef uint32_t xfs_agnumber_t; /* allocation group number */
> -typedef int32_t xfs_extnum_t; /* # of extents in a file */
> -typedef int16_t xfs_aextnum_t; /* # extents in an attribute fork */
> +typedef uint64_t xfs_extnum_t; /* # of extents in a file */
> +typedef uint32_t xfs_aextnum_t; /* # extents in an attribute fork */
> typedef int64_t xfs_fsize_t; /* bytes in a file */
> typedef uint64_t xfs_ufsize_t; /* unsigned bytes in a file */
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 6771f357ad2c..6813c2337da7 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3495,8 +3495,8 @@ xfs_iflush(
> if (XFS_TEST_ERROR(ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp) >
> ip->i_nblocks, mp, XFS_ERRTAG_IFLUSH_5)) {
> xfs_alert_tag(mp, XFS_PTAG_IFLUSH,
> - "%s: detected corrupt incore inode %Lu, "
> - "total extents = %d, nblocks = %Ld, ptr "PTR_FMT,
> + "%s: detected corrupt incore inode %llu, "
> + "total extents = %llu nblocks = %lld, ptr "PTR_FMT,
> __func__, ip->i_ino,
> ip->i_df.if_nextents + xfs_ifork_nextents(ip->i_afp),
> ip->i_nblocks, ip);
> diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
> index 3153db29de40..6b4a7f197308 100644
> --- a/fs/xfs/xfs_trace.h
> +++ b/fs/xfs/xfs_trace.h
> @@ -2182,7 +2182,7 @@ DECLARE_EVENT_CLASS(xfs_swap_extent_class,
> __entry->broot_size = ip->i_df.if_broot_bytes;
> __entry->fork_off = XFS_IFORK_BOFF(ip);
> ),
> - TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
> + TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
> "broot size %d, forkoff 0x%x",
> MAJOR(__entry->dev), MINOR(__entry->dev),
> __entry->ino,
> --
> 2.30.2
>
next prev parent reply other threads:[~2022-01-25 2:10 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 5:18 [PATCH V5 00/16] xfs: Extend per-inode extent counters Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 01/16] xfs: Move extent count limits to xfs_format.h Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 02/16] xfs: Introduce xfs_iext_max_nextents() helper Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 03/16] xfs: Use xfs_extnum_t instead of basic data types Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 04/16] xfs: Introduce xfs_dfork_nextents() helper Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 05/16] xfs: Use basic types to define xfs_log_dinode's di_nextents and di_anextents Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 06/16] xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Chandan Babu R
2022-01-25 0:32 ` Darrick J. Wong [this message]
2022-01-21 5:18 ` [PATCH V5 07/16] xfs: Introduce XFS_SB_FEAT_INCOMPAT_NREXT64 and associated per-fs feature bit Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 08/16] xfs: Introduce XFS_FSOP_GEOM_FLAGS_NREXT64 Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 09/16] xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 10/16] xfs: Use xfs_rfsblock_t to count maximum blocks that can be used by BMBT Chandan Babu R
2022-01-25 0:31 ` Darrick J. Wong
2022-01-21 5:18 ` [PATCH V5 11/16] xfs: Introduce macros to represent new maximum extent counts for data/attr forks Chandan Babu R
2022-02-01 18:49 ` Darrick J. Wong
2022-01-21 5:18 ` [PATCH V5 12/16] xfs: Introduce per-inode 64-bit extent counters Chandan Babu R
2022-01-25 22:51 ` kernel test robot
2022-01-26 8:50 ` Chandan Babu R
2022-02-01 18:51 ` Darrick J. Wong
2022-02-01 19:10 ` Darrick J. Wong
2022-02-07 4:54 ` Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 13/16] xfs: Conditionally upgrade existing inodes to use " Chandan Babu R
2022-02-01 20:01 ` Darrick J. Wong
2022-02-07 4:55 ` Chandan Babu R
2022-02-07 17:11 ` Darrick J. Wong
2022-02-11 12:10 ` Chandan Babu R
2022-02-14 17:07 ` Darrick J. Wong
2022-02-15 6:48 ` Chandan Babu R
2022-02-15 9:33 ` Dave Chinner
2022-02-15 11:33 ` Chandan Babu R
2022-02-15 13:16 ` Chandan Babu R
2022-02-16 1:16 ` Darrick J. Wong
2022-02-16 3:59 ` Dave Chinner
2022-02-16 12:34 ` Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 14/16] xfs: Enable bulkstat ioctl to support 64-bit per-inode " Chandan Babu R
2022-02-01 19:24 ` Darrick J. Wong
2022-02-07 4:56 ` Chandan Babu R
2022-02-07 9:46 ` Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 15/16] xfs: Add XFS_SB_FEAT_INCOMPAT_NREXT64 to the list of supported flags Chandan Babu R
2022-01-21 5:18 ` [PATCH V5 16/16] xfs: Define max extent length based on on-disk format definition Chandan Babu R
2022-02-01 19:26 ` Darrick J. Wong
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=20220125003205.GW13540@magnolia \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=lkp@intel.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