All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Chandan Babu R <chandanrlinux@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH V2 08/12] xfsprogs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively
Date: Tue, 27 Jul 2021 16:15:41 -0700	[thread overview]
Message-ID: <20210727231541.GY559212@magnolia> (raw)
In-Reply-To: <20210726114724.24956-9-chandanrlinux@gmail.com>

On Mon, Jul 26, 2021 at 05:17:20PM +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.
> 
> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>

xfs_repair changes look good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  libxfs/xfs_inode_fork.c |  2 +-
>  libxfs/xfs_types.h      |  4 ++--
>  repair/dinode.c         | 20 ++++++++++----------
>  repair/dinode.h         |  4 ++--
>  repair/scan.c           |  6 +++---
>  5 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/libxfs/xfs_inode_fork.c b/libxfs/xfs_inode_fork.c
> index 699bac823..8e2da89c7 100644
> --- a/libxfs/xfs_inode_fork.c
> +++ b/libxfs/xfs_inode_fork.c
> @@ -124,7 +124,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 %Lu ((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/libxfs/xfs_types.h b/libxfs/xfs_types.h
> index 8908346b1..584fa61e3 100644
> --- a/libxfs/xfs_types.h
> +++ b/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/repair/dinode.c b/repair/dinode.c
> index efff83ef9..beeb9ed07 100644
> --- a/repair/dinode.c
> +++ b/repair/dinode.c
> @@ -357,7 +357,7 @@ static int
>  process_bmbt_reclist_int(
>  	xfs_mount_t		*mp,
>  	xfs_bmbt_rec_t		*rp,
> -	int			*numrecs,
> +	xfs_extnum_t		*numrecs,
>  	int			type,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> @@ -680,7 +680,7 @@ int
>  process_bmbt_reclist(
>  	xfs_mount_t		*mp,
>  	xfs_bmbt_rec_t		*rp,
> -	int			*numrecs,
> +	xfs_extnum_t		*numrecs,
>  	int			type,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> @@ -703,7 +703,7 @@ int
>  scan_bmbt_reclist(
>  	xfs_mount_t		*mp,
>  	xfs_bmbt_rec_t		*rp,
> -	int			*numrecs,
> +	xfs_extnum_t		*numrecs,
>  	int			type,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> @@ -1089,7 +1089,7 @@ _("mismatch between format (%d) and size (%" PRId64 ") in symlink inode %" PRIu6
>  	 */
>  	if (numrecs > max_symlink_blocks)  {
>  		do_warn(
> -_("bad number of extents (%d) in symlink %" PRIu64 " data fork\n"),
> +_("bad number of extents (%lu) in symlink %" PRIu64 " data fork\n"),
>  			numrecs, lino);
>  		return(1);
>  	}
> @@ -1650,7 +1650,7 @@ _("realtime summary inode %" PRIu64 " has bad type 0x%x, "),
>  
>  		if (mp->m_sb.sb_rblocks == 0 && nextents != 0)  {
>  			do_warn(
> -_("bad # of extents (%d) for realtime summary inode %" PRIu64 "\n"),
> +_("bad # of extents (%lu) for realtime summary inode %" PRIu64 "\n"),
>  				nextents, lino);
>  			return 1;
>  		}
> @@ -1675,7 +1675,7 @@ _("realtime bitmap inode %" PRIu64 " has bad type 0x%x, "),
>  
>                  if (mp->m_sb.sb_rblocks == 0 && nextents != 0)  {
>  			do_warn(
> -_("bad # of extents (%d) for realtime bitmap inode %" PRIu64 "\n"),
> +_("bad # of extents (%lu) for realtime bitmap inode %" PRIu64 "\n"),
>  				nextents, lino);
>  			return 1;
>  		}
> @@ -1868,13 +1868,13 @@ _("too many data fork extents (%" PRIu64 ") in inode %" PRIu64 "\n"),
>  	if (nextents != dnextents)  {
>  		if (!no_modify)  {
>  			do_warn(
> -_("correcting nextents for inode %" PRIu64 ", was %d - counted %" PRIu64 "\n"),
> +_("correcting nextents for inode %" PRIu64 ", was %lu - counted %" PRIu64 "\n"),
>  				lino, dnextents, nextents);
>  			dino->di_nextents32 = cpu_to_be32(nextents);
>  			*dirty = 1;
>  		} else  {
>  			do_warn(
> -_("bad nextents %d for inode %" PRIu64 ", would reset to %" PRIu64 "\n"),
> +_("bad nextents %lu for inode %" PRIu64 ", would reset to %" PRIu64 "\n"),
>  				dnextents, lino, nextents);
>  		}
>  	}
> @@ -1892,13 +1892,13 @@ _("too many attr fork extents (%" PRIu64 ") in inode %" PRIu64 "\n"),
>  	if (anextents != dnextents)  {
>  		if (!no_modify)  {
>  			do_warn(
> -_("correcting anextents for inode %" PRIu64 ", was %d - counted %" PRIu64 "\n"),
> +_("correcting anextents for inode %" PRIu64 ", was %lu - counted %" PRIu64 "\n"),
>  				lino, dnextents, anextents);
>  			dino->di_nextents16 = cpu_to_be16(anextents);
>  			*dirty = 1;
>  		} else  {
>  			do_warn(
> -_("bad anextents %d for inode %" PRIu64 ", would reset to %" PRIu64 "\n"),
> +_("bad anextents %lu for inode %" PRIu64 ", would reset to %" PRIu64 "\n"),
>  				dnextents, lino, anextents);
>  		}
>  	}
> diff --git a/repair/dinode.h b/repair/dinode.h
> index e190b7435..09129e7b5 100644
> --- a/repair/dinode.h
> +++ b/repair/dinode.h
> @@ -20,7 +20,7 @@ convert_extent(
>  int
>  process_bmbt_reclist(xfs_mount_t	*mp,
>  		xfs_bmbt_rec_t		*rp,
> -		int			*numrecs,
> +		xfs_extnum_t		*numrecs,
>  		int			type,
>  		xfs_ino_t		ino,
>  		xfs_rfsblock_t		*tot,
> @@ -34,7 +34,7 @@ int
>  scan_bmbt_reclist(
>  	xfs_mount_t		*mp,
>  	xfs_bmbt_rec_t		*rp,
> -	int			*numrecs,
> +	xfs_extnum_t		*numrecs,
>  	int			type,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> diff --git a/repair/scan.c b/repair/scan.c
> index 86fa8b4dd..76021cff0 100644
> --- a/repair/scan.c
> +++ b/repair/scan.c
> @@ -223,7 +223,7 @@ scan_bmapbt(
>  	xfs_fileoff_t		first_key;
>  	xfs_fileoff_t		last_key;
>  	char			*forkname = get_forkname(whichfork);
> -	int			numrecs;
> +	xfs_extnum_t		numrecs;
>  	xfs_agnumber_t		agno;
>  	xfs_agblock_t		agbno;
>  	int			state;
> @@ -443,7 +443,7 @@ _("couldn't add inode %"PRIu64" bmbt block %"PRIu64" reverse-mapping data."),
>  		if (numrecs > mp->m_bmap_dmxr[0] || (isroot == 0 && numrecs <
>  							mp->m_bmap_dmnr[0])) {
>  				do_warn(
> -_("inode %" PRIu64 " bad # of bmap records (%u, min - %u, max - %u)\n"),
> +_("inode %" PRIu64 " bad # of bmap records (%lu, min - %u, max - %u)\n"),
>  					ino, numrecs, mp->m_bmap_dmnr[0],
>  					mp->m_bmap_dmxr[0]);
>  			return(1);
> @@ -495,7 +495,7 @@ _("out-of-order bmap key (file offset) in inode %" PRIu64 ", %s fork, fsbno %" P
>  	if (numrecs > mp->m_bmap_dmxr[1] || (isroot == 0 && numrecs <
>  							mp->m_bmap_dmnr[1])) {
>  		do_warn(
> -_("inode %" PRIu64 " bad # of bmap records (%u, min - %u, max - %u)\n"),
> +_("inode %" PRIu64 " bad # of bmap records (%lu, min - %u, max - %u)\n"),
>  			ino, numrecs, mp->m_bmap_dmnr[1], mp->m_bmap_dmxr[1]);
>  		return(1);
>  	}
> -- 
> 2.30.2
> 

  reply	other threads:[~2021-07-27 23:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 11:47 [PATCH V2 00/12] xfsprogs: Extend per-inode extent counters Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 01/12] xfsprogs: Move extent count limits to xfs_format.h Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 02/12] xfsprogs: Rename MAXEXTNUM, MAXAEXTNUM to XFS_IFORK_EXTCNT_MAXS32, XFS_IFORK_EXTCNT_MAXS16 Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 03/12] xfsprogs: Introduce xfs_iext_max() helper Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 04/12] xfsprogs: Use xfs_extnum_t instead of basic data types Chandan Babu R
2021-07-27 23:11   ` Darrick J. Wong
2021-07-26 11:47 ` [PATCH V2 05/12] xfsprogs: Introduce xfs_dfork_nextents() helper Chandan Babu R
2021-07-27 23:14   ` Darrick J. Wong
2021-07-28  7:34     ` Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 06/12] xfsprogs: xfs_dfork_nextents: Return extent count via an out argument Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 07/12] xfsprogs: Rename inode's extent counter fields based on their width Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 08/12] xfsprogs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively Chandan Babu R
2021-07-27 23:15   ` Darrick J. Wong [this message]
2021-07-26 11:47 ` [PATCH V2 09/12] xfsprogs: Rename XFS_IOC_BULKSTAT to XFS_IOC_BULKSTAT_V5 Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 10/12] xfsprogs: Enable bulkstat ioctl to support 64-bit extent counters Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 11/12] xfsprogs: Extend per-inode extent counter widths Chandan Babu R
2021-07-28 19:11   ` Darrick J. Wong
2021-07-29  7:26     ` Chandan Babu R
2021-07-26 11:47 ` [PATCH V2 12/12] xfsprogs: Add extcnt64bit mkfs option Chandan Babu R

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=20210727231541.GY559212@magnolia \
    --to=djwong@kernel.org \
    --cc=chandanrlinux@gmail.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.