All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: Dave Chinner <dchinner@redhat.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-xfs@vger.kernel.org
Subject: [PATCH 44/45] xfs: convert bp->b_bn references to xfs_buf_daddr()
Date: Wed, 19 Jan 2022 16:21:25 -0800	[thread overview]
Message-ID: <164263808570.860211.3046983085685727158.stgit@magnolia> (raw)
In-Reply-To: <164263784199.860211.7509808171577819673.stgit@magnolia>

From: Dave Chinner <dchinner@redhat.com>

Source kernel commit: 9343ee76909e3f6466d85c9ebb0e343cdf54de71

Stop directly referencing b_bn in code outside the buffer cache, as
b_bn is supposed to be used only as an internal cache index.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 db/metadump.c               |    2 +-
 libxfs/util.c               |    4 ++--
 libxfs/xfs_ag.c             |    1 -
 libxfs/xfs_attr_leaf.c      |    4 ++--
 libxfs/xfs_attr_remote.c    |    8 ++++----
 libxfs/xfs_bmap.c           |    2 +-
 libxfs/xfs_btree.c          |   25 +++++++++++++------------
 libxfs/xfs_da_btree.c       |    8 ++++----
 libxfs/xfs_dir2_block.c     |    4 ++--
 libxfs/xfs_dir2_data.c      |    4 ++--
 libxfs/xfs_dir2_leaf.c      |    4 ++--
 libxfs/xfs_dir2_node.c      |    6 +++---
 libxfs/xfs_inode_buf.c      |    2 +-
 libxfs/xfs_sb.c             |    2 +-
 libxfs/xfs_symlink_remote.c |    4 ++--
 repair/attr_repair.c        |    8 ++++----
 repair/phase6.c             |    8 ++++----
 repair/xfs_repair.c         |    2 +-
 18 files changed, 49 insertions(+), 49 deletions(-)


diff --git a/db/metadump.c b/db/metadump.c
index 2c649c15..48cda88a 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -204,7 +204,7 @@ write_buf(
 			print_warning(
 			    "obfuscation corrupted block at %s bno 0x%llx/0x%x",
 				bp->b_ops->name,
-				(long long)bp->b_bn, BBTOB(bp->b_length));
+				(long long)xfs_buf_daddr(bp), BBTOB(bp->b_length));
 		}
 	}
 
diff --git a/libxfs/util.c b/libxfs/util.c
index 9c8230cd..69cc477c 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -556,7 +556,7 @@ xfs_verifier_error(
 	xfs_alert(NULL, "Metadata %s detected at %p, %s block 0x%llx/0x%x",
 		  bp->b_error == -EFSBADCRC ? "CRC error" : "corruption",
 		  failaddr ? failaddr : __return_address,
-		  bp->b_ops->name, bp->b_bn, BBTOB(bp->b_length));
+		  bp->b_ops->name, xfs_buf_daddr(bp), BBTOB(bp->b_length));
 }
 
 /*
@@ -589,7 +589,7 @@ xfs_buf_corruption_error(
 	xfs_failaddr_t		fa)
 {
 	xfs_alert(NULL, "Metadata corruption detected at %p, %s block 0x%llx",
-		  fa, bp->b_ops->name, bp->b_bn);
+		  fa, bp->b_ops->name, xfs_buf_daddr(bp));
 }
 
 /*
diff --git a/libxfs/xfs_ag.c b/libxfs/xfs_ag.c
index 6691ca70..c95e8b26 100644
--- a/libxfs/xfs_ag.c
+++ b/libxfs/xfs_ag.c
@@ -313,7 +313,6 @@ xfs_get_aghdr_buf(
 	if (error)
 		return error;
 
-	bp->b_bn = blkno;
 	bp->b_maps[0].bm_bn = blkno;
 	bp->b_ops = ops;
 
diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c
index 308fc0f7..76a52573 100644
--- a/libxfs/xfs_attr_leaf.c
+++ b/libxfs/xfs_attr_leaf.c
@@ -1203,7 +1203,7 @@ xfs_attr3_leaf_to_node(
 	memcpy(bp2->b_addr, bp1->b_addr, args->geo->blksize);
 	if (xfs_has_crc(mp)) {
 		struct xfs_da3_blkinfo *hdr3 = bp2->b_addr;
-		hdr3->blkno = cpu_to_be64(bp2->b_bn);
+		hdr3->blkno = cpu_to_be64(xfs_buf_daddr(bp2));
 	}
 	xfs_trans_log_buf(args->trans, bp2, 0, args->geo->blksize - 1);
 
@@ -1271,7 +1271,7 @@ xfs_attr3_leaf_create(
 
 		ichdr.magic = XFS_ATTR3_LEAF_MAGIC;
 
-		hdr3->blkno = cpu_to_be64(bp->b_bn);
+		hdr3->blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		hdr3->owner = cpu_to_be64(dp->i_ino);
 		uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid);
 
diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
index 73eb256e..afa93290 100644
--- a/libxfs/xfs_attr_remote.c
+++ b/libxfs/xfs_attr_remote.c
@@ -129,7 +129,7 @@ __xfs_attr3_rmt_read_verify(
 		return 0;
 
 	ptr = bp->b_addr;
-	bno = bp->b_bn;
+	bno = xfs_buf_daddr(bp);
 	len = BBTOB(bp->b_length);
 	ASSERT(len >= blksize);
 
@@ -194,7 +194,7 @@ xfs_attr3_rmt_write_verify(
 		return;
 
 	ptr = bp->b_addr;
-	bno = bp->b_bn;
+	bno = xfs_buf_daddr(bp);
 	len = BBTOB(bp->b_length);
 	ASSERT(len >= blksize);
 
@@ -283,7 +283,7 @@ xfs_attr_rmtval_copyout(
 	uint8_t		**dst)
 {
 	char		*src = bp->b_addr;
-	xfs_daddr_t	bno = bp->b_bn;
+	xfs_daddr_t	bno = xfs_buf_daddr(bp);
 	int		len = BBTOB(bp->b_length);
 	int		blksize = mp->m_attr_geo->blksize;
 
@@ -331,7 +331,7 @@ xfs_attr_rmtval_copyin(
 	uint8_t		**src)
 {
 	char		*dst = bp->b_addr;
-	xfs_daddr_t	bno = bp->b_bn;
+	xfs_daddr_t	bno = xfs_buf_daddr(bp);
 	int		len = BBTOB(bp->b_length);
 	int		blksize = mp->m_attr_geo->blksize;
 
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index 1edf6236..d5ccce1f 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -732,7 +732,7 @@ xfs_bmap_extents_to_btree(
 	 */
 	abp->b_ops = &xfs_bmbt_buf_ops;
 	ablock = XFS_BUF_TO_BLOCK(abp);
-	xfs_btree_init_block_int(mp, ablock, abp->b_bn,
+	xfs_btree_init_block_int(mp, ablock, xfs_buf_daddr(abp),
 				XFS_BTNUM_BMAP, 0, 0, ip->i_ino,
 				XFS_BTREE_LONG_PTRS);
 
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 2f86ab68..3d9d0dcc 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -67,7 +67,7 @@ __xfs_btree_check_lblock(
 		if (!uuid_equal(&block->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
 		if (block->bb_u.l.bb_blkno !=
-		    cpu_to_be64(bp ? bp->b_bn : XFS_BUF_DADDR_NULL))
+		    cpu_to_be64(bp ? xfs_buf_daddr(bp) : XFS_BUF_DADDR_NULL))
 			return __this_address;
 		if (block->bb_u.l.bb_pad != cpu_to_be32(0))
 			return __this_address;
@@ -132,7 +132,7 @@ __xfs_btree_check_sblock(
 		if (!uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
 		if (block->bb_u.s.bb_blkno !=
-		    cpu_to_be64(bp ? bp->b_bn : XFS_BUF_DADDR_NULL))
+		    cpu_to_be64(bp ? xfs_buf_daddr(bp) : XFS_BUF_DADDR_NULL))
 			return __this_address;
 	}
 
@@ -1128,7 +1128,7 @@ xfs_btree_init_block(
 	__u16		numrecs,
 	__u64		owner)
 {
-	xfs_btree_init_block_int(mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn,
+	xfs_btree_init_block_int(mp, XFS_BUF_TO_BLOCK(bp), xfs_buf_daddr(bp),
 				 btnum, level, numrecs, owner, 0);
 }
 
@@ -1152,9 +1152,9 @@ xfs_btree_init_block_cur(
 	else
 		owner = cur->bc_ag.pag->pag_agno;
 
-	xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp), bp->b_bn,
-				 cur->bc_btnum, level, numrecs,
-				 owner, cur->bc_flags);
+	xfs_btree_init_block_int(cur->bc_mp, XFS_BUF_TO_BLOCK(bp),
+				xfs_buf_daddr(bp), cur->bc_btnum, level,
+				numrecs, owner, cur->bc_flags);
 }
 
 /*
@@ -2924,10 +2924,11 @@ xfs_btree_new_iroot(
 	 */
 	memcpy(cblock, block, xfs_btree_block_len(cur));
 	if (cur->bc_flags & XFS_BTREE_CRC_BLOCKS) {
+		__be64 bno = cpu_to_be64(xfs_buf_daddr(cbp));
 		if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
-			cblock->bb_u.l.bb_blkno = cpu_to_be64(cbp->b_bn);
+			cblock->bb_u.l.bb_blkno = bno;
 		else
-			cblock->bb_u.s.bb_blkno = cpu_to_be64(cbp->b_bn);
+			cblock->bb_u.s.bb_blkno = bno;
 	}
 
 	be16_add_cpu(&block->bb_level, 1);
@@ -3226,7 +3227,7 @@ xfs_btree_insrec(
 
 	/* Get pointers to the btree buffer and block. */
 	block = xfs_btree_get_block(cur, level, &bp);
-	old_bn = bp ? bp->b_bn : XFS_BUF_DADDR_NULL;
+	old_bn = bp ? xfs_buf_daddr(bp) : XFS_BUF_DADDR_NULL;
 	numrecs = xfs_btree_get_numrecs(block);
 
 #ifdef DEBUG
@@ -3342,7 +3343,7 @@ xfs_btree_insrec(
 	 * some records into the new tree block), so use the regular key
 	 * update mechanism.
 	 */
-	if (bp && bp->b_bn != old_bn) {
+	if (bp && xfs_buf_daddr(bp) != old_bn) {
 		xfs_btree_get_keys(cur, block, lkey);
 	} else if (xfs_btree_needs_key_update(cur, optr)) {
 		error = xfs_btree_update_keys(cur, level);
@@ -4423,7 +4424,7 @@ xfs_btree_lblock_v5hdr_verify(
 		return __this_address;
 	if (!uuid_equal(&block->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid))
 		return __this_address;
-	if (block->bb_u.l.bb_blkno != cpu_to_be64(bp->b_bn))
+	if (block->bb_u.l.bb_blkno != cpu_to_be64(xfs_buf_daddr(bp)))
 		return __this_address;
 	if (owner != XFS_RMAP_OWN_UNKNOWN &&
 	    be64_to_cpu(block->bb_u.l.bb_owner) != owner)
@@ -4473,7 +4474,7 @@ xfs_btree_sblock_v5hdr_verify(
 		return __this_address;
 	if (!uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid))
 		return __this_address;
-	if (block->bb_u.s.bb_blkno != cpu_to_be64(bp->b_bn))
+	if (block->bb_u.s.bb_blkno != cpu_to_be64(xfs_buf_daddr(bp)))
 		return __this_address;
 	if (pag && be32_to_cpu(block->bb_u.s.bb_owner) != pag->pag_agno)
 		return __this_address;
diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
index d2dec4aa..0e504d2d 100644
--- a/libxfs/xfs_da_btree.c
+++ b/libxfs/xfs_da_btree.c
@@ -191,7 +191,7 @@ xfs_da3_blkinfo_verify(
 	if (xfs_has_crc(mp)) {
 		if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
-		if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
+		if (be64_to_cpu(hdr3->blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 		if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn)))
 			return __this_address;
@@ -444,7 +444,7 @@ xfs_da3_node_create(
 
 		memset(hdr3, 0, sizeof(struct xfs_da3_node_hdr));
 		ichdr.magic = XFS_DA3_NODE_MAGIC;
-		hdr3->info.blkno = cpu_to_be64(bp->b_bn);
+		hdr3->info.blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		hdr3->info.owner = cpu_to_be64(args->dp->i_ino);
 		uuid_copy(&hdr3->info.uuid, &mp->m_sb.sb_meta_uuid);
 	} else {
@@ -708,7 +708,7 @@ xfs_da3_root_split(
 	    oldroot->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)) {
 		struct xfs_da3_intnode *node3 = (struct xfs_da3_intnode *)node;
 
-		node3->hdr.info.blkno = cpu_to_be64(bp->b_bn);
+		node3->hdr.info.blkno = cpu_to_be64(xfs_buf_daddr(bp));
 	}
 	xfs_trans_log_buf(tp, bp, 0, size - 1);
 
@@ -1216,7 +1216,7 @@ xfs_da3_root_join(
 	xfs_trans_buf_copy_type(root_blk->bp, bp);
 	if (oldroothdr.magic == XFS_DA3_NODE_MAGIC) {
 		struct xfs_da3_blkinfo *da3 = root_blk->bp->b_addr;
-		da3->blkno = cpu_to_be64(root_blk->bp->b_bn);
+		da3->blkno = cpu_to_be64(xfs_buf_daddr(root_blk->bp));
 	}
 	xfs_trans_log_buf(args->trans, root_blk->bp, 0,
 			  args->geo->blksize - 1);
diff --git a/libxfs/xfs_dir2_block.c b/libxfs/xfs_dir2_block.c
index f5d0f703..1b8c2521 100644
--- a/libxfs/xfs_dir2_block.c
+++ b/libxfs/xfs_dir2_block.c
@@ -53,7 +53,7 @@ xfs_dir3_block_verify(
 	if (xfs_has_crc(mp)) {
 		if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
-		if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
+		if (be64_to_cpu(hdr3->blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 		if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn)))
 			return __this_address;
@@ -171,7 +171,7 @@ xfs_dir3_block_init(
 	if (xfs_has_crc(mp)) {
 		memset(hdr3, 0, sizeof(*hdr3));
 		hdr3->magic = cpu_to_be32(XFS_DIR3_BLOCK_MAGIC);
-		hdr3->blkno = cpu_to_be64(bp->b_bn);
+		hdr3->blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		hdr3->owner = cpu_to_be64(dp->i_ino);
 		uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid);
 		return;
diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c
index 85cb14d3..4e207986 100644
--- a/libxfs/xfs_dir2_data.c
+++ b/libxfs/xfs_dir2_data.c
@@ -297,7 +297,7 @@ xfs_dir3_data_verify(
 	if (xfs_has_crc(mp)) {
 		if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
-		if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
+		if (be64_to_cpu(hdr3->blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 		if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn)))
 			return __this_address;
@@ -719,7 +719,7 @@ xfs_dir3_data_init(
 
 		memset(hdr3, 0, sizeof(*hdr3));
 		hdr3->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC);
-		hdr3->blkno = cpu_to_be64(bp->b_bn);
+		hdr3->blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		hdr3->owner = cpu_to_be64(dp->i_ino);
 		uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid);
 
diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c
index 70b1f083..8827c96c 100644
--- a/libxfs/xfs_dir2_leaf.c
+++ b/libxfs/xfs_dir2_leaf.c
@@ -106,7 +106,7 @@ xfs_dir3_leaf1_check(
 
 	if (leafhdr.magic == XFS_DIR3_LEAF1_MAGIC) {
 		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
-		if (be64_to_cpu(leaf3->info.blkno) != bp->b_bn)
+		if (be64_to_cpu(leaf3->info.blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 	} else if (leafhdr.magic != XFS_DIR2_LEAF1_MAGIC)
 		return __this_address;
@@ -314,7 +314,7 @@ xfs_dir3_leaf_init(
 		leaf3->info.hdr.magic = (type == XFS_DIR2_LEAF1_MAGIC)
 					 ? cpu_to_be16(XFS_DIR3_LEAF1_MAGIC)
 					 : cpu_to_be16(XFS_DIR3_LEAFN_MAGIC);
-		leaf3->info.blkno = cpu_to_be64(bp->b_bn);
+		leaf3->info.blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		leaf3->info.owner = cpu_to_be64(owner);
 		uuid_copy(&leaf3->info.uuid, &mp->m_sb.sb_meta_uuid);
 	} else {
diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c
index e7ed4b46..c0eb335c 100644
--- a/libxfs/xfs_dir2_node.c
+++ b/libxfs/xfs_dir2_node.c
@@ -65,7 +65,7 @@ xfs_dir3_leafn_check(
 
 	if (leafhdr.magic == XFS_DIR3_LEAFN_MAGIC) {
 		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
-		if (be64_to_cpu(leaf3->info.blkno) != bp->b_bn)
+		if (be64_to_cpu(leaf3->info.blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 	} else if (leafhdr.magic != XFS_DIR2_LEAFN_MAGIC)
 		return __this_address;
@@ -107,7 +107,7 @@ xfs_dir3_free_verify(
 
 		if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
 			return __this_address;
-		if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
+		if (be64_to_cpu(hdr3->blkno) != xfs_buf_daddr(bp))
 			return __this_address;
 		if (!xfs_log_check_lsn(mp, be64_to_cpu(hdr3->lsn)))
 			return __this_address;
@@ -343,7 +343,7 @@ xfs_dir3_free_get_buf(
 
 		hdr.magic = XFS_DIR3_FREE_MAGIC;
 
-		hdr3->hdr.blkno = cpu_to_be64(bp->b_bn);
+		hdr3->hdr.blkno = cpu_to_be64(xfs_buf_daddr(bp));
 		hdr3->hdr.owner = cpu_to_be64(dp->i_ino);
 		uuid_copy(&hdr3->hdr.uuid, &mp->m_sb.sb_meta_uuid);
 	} else
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 516dab25..68bd5f52 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -68,7 +68,7 @@ xfs_inode_buf_verify(
 #ifdef DEBUG
 			xfs_alert(mp,
 				"bad inode magic/vsn daddr %lld #%d (magic=%x)",
-				(unsigned long long)bp->b_bn, i,
+				(unsigned long long)xfs_buf_daddr(bp), i,
 				be16_to_cpu(dip->di_magic));
 #endif
 			xfs_buf_verifier_error(bp, -EFSCORRUPTED,
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 680441ae..d7e3526c 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -745,7 +745,7 @@ xfs_sb_read_verify(
 
 		if (!xfs_buf_verify_cksum(bp, XFS_SB_CRC_OFF)) {
 			/* Only fail bad secondaries on a known V5 filesystem */
-			if (bp->b_maps[0].bm_bn == XFS_SB_DADDR ||
+			if (xfs_buf_daddr(bp) == XFS_SB_DADDR ||
 			    xfs_has_crc(mp)) {
 				error = -EFSBADCRC;
 				goto out_error;
diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c
index e0a68319..a5cbb40f 100644
--- a/libxfs/xfs_symlink_remote.c
+++ b/libxfs/xfs_symlink_remote.c
@@ -48,7 +48,7 @@ xfs_symlink_hdr_set(
 	dsl->sl_bytes = cpu_to_be32(size);
 	uuid_copy(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid);
 	dsl->sl_owner = cpu_to_be64(ino);
-	dsl->sl_blkno = cpu_to_be64(bp->b_bn);
+	dsl->sl_blkno = cpu_to_be64(xfs_buf_daddr(bp));
 	bp->b_ops = &xfs_symlink_buf_ops;
 
 	return sizeof(struct xfs_dsymlink_hdr);
@@ -92,7 +92,7 @@ xfs_symlink_verify(
 		return __this_address;
 	if (!uuid_equal(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid))
 		return __this_address;
-	if (bp->b_bn != be64_to_cpu(dsl->sl_blkno))
+	if (xfs_buf_daddr(bp) != be64_to_cpu(dsl->sl_blkno))
 		return __this_address;
 	if (be32_to_cpu(dsl->sl_offset) +
 				be32_to_cpu(dsl->sl_bytes) >= XFS_SYMLINK_MAXLEN)
diff --git a/repair/attr_repair.c b/repair/attr_repair.c
index df1b519f..927dd095 100644
--- a/repair/attr_repair.c
+++ b/repair/attr_repair.c
@@ -935,14 +935,14 @@ __check_attr_header(
 		do_warn(
 _("expected owner inode %" PRIu64 ", got %llu, attr block %" PRIu64 "\n"),
 			ino, (unsigned long long)be64_to_cpu(info->owner),
-			bp->b_bn);
+			xfs_buf_daddr(bp));
 		return 1;
 	}
 	/* verify block number */
-	if (be64_to_cpu(info->blkno) != bp->b_bn) {
+	if (be64_to_cpu(info->blkno) != xfs_buf_daddr(bp)) {
 		do_warn(
 _("expected block %" PRIu64 ", got %llu, inode %" PRIu64 "attr block\n"),
-			bp->b_bn, (unsigned long long)be64_to_cpu(info->blkno),
+			xfs_buf_daddr(bp), (unsigned long long)be64_to_cpu(info->blkno),
 			ino);
 		return 1;
 	}
@@ -950,7 +950,7 @@ _("expected block %" PRIu64 ", got %llu, inode %" PRIu64 "attr block\n"),
 	if (platform_uuid_compare(&info->uuid, &mp->m_sb.sb_meta_uuid) != 0) {
 		do_warn(
 _("wrong FS UUID, inode %" PRIu64 " attr block %" PRIu64 "\n"),
-			ino, bp->b_bn);
+			ino, xfs_buf_daddr(bp));
 		return 1;
 	}
 
diff --git a/repair/phase6.c b/repair/phase6.c
index 647dc1c5..9e60c87b 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -1905,21 +1905,21 @@ __check_dir3_header(
 	if (be64_to_cpu(owner) != ino) {
 		do_warn(
 _("expected owner inode %" PRIu64 ", got %llu, directory block %" PRIu64 "\n"),
-			ino, (unsigned long long)be64_to_cpu(owner), bp->b_bn);
+			ino, (unsigned long long)be64_to_cpu(owner), xfs_buf_daddr(bp));
 		return 1;
 	}
 	/* verify block number */
-	if (be64_to_cpu(blkno) != bp->b_bn) {
+	if (be64_to_cpu(blkno) != xfs_buf_daddr(bp)) {
 		do_warn(
 _("expected block %" PRIu64 ", got %llu, directory inode %" PRIu64 "\n"),
-			bp->b_bn, (unsigned long long)be64_to_cpu(blkno), ino);
+			xfs_buf_daddr(bp), (unsigned long long)be64_to_cpu(blkno), ino);
 		return 1;
 	}
 	/* verify uuid */
 	if (platform_uuid_compare(uuid, &mp->m_sb.sb_meta_uuid) != 0) {
 		do_warn(
 _("wrong FS UUID, directory inode %" PRIu64 " block %" PRIu64 "\n"),
-			ino, bp->b_bn);
+			ino, xfs_buf_daddr(bp));
 		return 1;
 	}
 
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index bcd44cd5..4769c130 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -850,7 +850,7 @@ repair_capture_writeback(
 	 * avoid hook recursion when setting NEEDSREPAIR.  Higher level code
 	 * modifying an sb must control the flag manually.
 	 */
-	if (bp->b_ops == &xfs_sb_buf_ops || bp->b_bn == XFS_SB_DADDR)
+	if (bp->b_ops == &xfs_sb_buf_ops || xfs_buf_daddr(bp) == XFS_SB_DADDR)
 		return;
 
 	pthread_mutex_lock(&wb_mutex);


  parent reply	other threads:[~2022-01-20  0:21 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  0:17 [PATCHSET 00/45] xfsprogs: sync libxfs with 5.15 Darrick J. Wong
2022-01-20  0:17 ` [PATCH 01/45] xfsprogs: fix static build problems caused by liburcu Darrick J. Wong
2022-01-20  0:17 ` [PATCH 02/45] xfs_{copy,db,logprint,repair}: pass xfs_mount pointers instead of xfs_sb pointers Darrick J. Wong
2022-01-28 22:01   ` Eric Sandeen
2022-01-20  0:17 ` [PATCH 03/45] xfs: remove support for disabling quota accounting on a mounted file system Darrick J. Wong
2022-01-20  0:17 ` [PATCH 04/45] xfs: remove the active vs running quota differentiation Darrick J. Wong
2022-01-20  0:17 ` [PATCH 05/45] xfs: replace kmem_alloc_large() with kvmalloc() Darrick J. Wong
2022-01-20  0:17 ` [PATCH 06/45] xfs: allow setting and clearing of log incompat feature flags Darrick J. Wong
2022-01-20  0:18 ` [PATCH 07/45] xfs: add attr state machine tracepoints Darrick J. Wong
2022-01-20  0:18 ` [PATCH 08/45] xfs: Rename __xfs_attr_rmtval_remove Darrick J. Wong
2022-01-20  0:18 ` [PATCH 09/45] xfs: make xfs_rtalloc_query_range input parameters const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 10/45] xfs: make the key parameters to all btree key comparison functions const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 11/45] xfs: make the key parameters to all btree query range " Darrick J. Wong
2022-01-20  0:18 ` [PATCH 12/45] xfs: make the record pointer passed to query_range " Darrick J. Wong
2022-01-20  0:18 ` [PATCH 13/45] xfs: mark the record passed into btree init_key functions as const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 14/45] xfs: make the keys and records passed to btree inorder functions const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 15/45] xfs: mark the record passed into xchk_btree functions as const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 16/45] xfs: make the pointer passed to btree set_root functions const Darrick J. Wong
2022-01-20  0:18 ` [PATCH 17/45] xfs: make the start pointer passed to btree alloc_block " Darrick J. Wong
2022-01-20  0:19 ` [PATCH 18/45] xfs: make the start pointer passed to btree update_lastrec " Darrick J. Wong
2022-01-20  0:19 ` [PATCH 19/45] xfs: constify btree function parameters that are not modified Darrick J. Wong
2022-01-20  0:19 ` [PATCH 20/45] xfs: resolve fork names in trace output Darrick J. Wong
2022-01-20  0:19 ` [PATCH 21/45] xfs: sb verifier doesn't handle uncached sb buffer Darrick J. Wong
2022-01-20  0:19 ` [PATCH 22/45] xfs: rename xfs_has_attr() Darrick J. Wong
2022-01-20  0:19 ` [PATCH 23/45] xfs: rework attr2 feature and mount options Darrick J. Wong
2022-01-20  0:19 ` [PATCH 24/45] xfs: reflect sb features in xfs_mount Darrick J. Wong
2022-01-20  0:19 ` [PATCH 25/45] xfs: replace xfs_sb_version checks with feature flag checks Darrick J. Wong
2022-01-20  0:19 ` [PATCH 26/45] xfs: convert mount flags to features Darrick J. Wong
2022-01-31 22:59   ` Eric Sandeen
2022-01-31 23:31     ` Darrick J. Wong
2022-01-20  0:19 ` [PATCH 27/45] xfs: convert remaining mount flags to state flags Darrick J. Wong
2022-01-20  0:19 ` [PATCH 28/45] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown Darrick J. Wong
2022-01-20  0:20 ` [PATCH 29/45] xfs: convert xfs_fs_geometry to use mount feature checks Darrick J. Wong
2022-01-20  0:20 ` [PATCH 30/45] xfs: open code sb verifier " Darrick J. Wong
2022-01-20  0:20 ` [PATCH 31/45] xfs: convert xfs_sb_version_has checks to use mount features Darrick J. Wong
2022-01-20  0:20 ` [PATCH 32/45] libxlog: replace xfs_sb_version checks with feature flag checks Darrick J. Wong
2022-01-28 22:03   ` Eric Sandeen
2022-01-20  0:20 ` [PATCH 33/45] libxfs: " Darrick J. Wong
2022-01-28 22:13   ` Eric Sandeen
2022-01-28 22:18     ` Darrick J. Wong
2022-01-20  0:20 ` [PATCH 34/45] xfs_{copy,db,logprint,repair}: " Darrick J. Wong
2022-01-28 22:16   ` Eric Sandeen
2022-01-20  0:20 ` [PATCH 35/45] xfs: remove unused xfs_sb_version_has wrappers Darrick J. Wong
2022-01-20  0:20 ` [PATCH 36/45] xfs: introduce xfs_sb_is_v5 helper Darrick J. Wong
2022-01-20  0:20 ` [PATCH 37/45] xfs: kill xfs_sb_version_has_v3inode() Darrick J. Wong
2022-01-20  0:20 ` [PATCH 38/45] libxfs: use opstate flags and functions for libxfs mount options Darrick J. Wong
2022-01-27 20:43   ` Eric Sandeen
2022-01-20  0:20 ` [PATCH 39/45] libxfs: remove pointless *XFS_MOUNT* flags Darrick J. Wong
2022-01-27 23:03   ` Eric Sandeen
2022-01-28  0:53     ` Darrick J. Wong
2022-01-28 20:01   ` Eric Sandeen
2022-01-28 21:59     ` Darrick J. Wong
2022-01-28 22:43   ` [PATCH v1.1 " Darrick J. Wong
2022-01-28 22:59     ` Eric Sandeen
2022-01-31 21:29     ` Eric Sandeen
2022-01-20  0:21 ` [PATCH 40/45] libxfs: clean up remaining LIBXFS_MOUNT flags Darrick J. Wong
2022-01-28 20:12   ` Eric Sandeen
2022-01-20  0:21 ` [PATCH 41/45] libxfs: always initialize internal buffer map Darrick J. Wong
2022-01-28 20:31   ` Eric Sandeen
2022-01-28 22:03     ` Darrick J. Wong
2022-01-28 22:27       ` Eric Sandeen
2022-01-31 20:30   ` Eric Sandeen
2022-01-20  0:21 ` [PATCH 42/45] libxfs: replace XFS_BUF_SET_ADDR with a function Darrick J. Wong
2022-01-28 20:53   ` Eric Sandeen
2022-01-28 23:04     ` Darrick J. Wong
2022-01-31 20:44       ` Eric Sandeen
2022-01-20  0:21 ` [PATCH 43/45] xfs: introduce xfs_buf_daddr() Darrick J. Wong
2022-01-20  0:21 ` Darrick J. Wong [this message]
2022-01-20  0:21 ` [PATCH 45/45] libxfs: rename buffer cache index variable b_bn Darrick J. Wong
2022-01-28 21:37   ` Eric Sandeen
2022-01-28 22:14     ` Darrick J. Wong
2022-01-28 22:31       ` Eric Sandeen
2022-01-28 20:54 ` [PATCHSET 00/45] xfsprogs: sync libxfs with 5.15 Eric Sandeen

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=164263808570.860211.3046983085685727158.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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.