Skip to contentSkip to conversation

xfs: split an assert in xfs_trans_log_buf

PATCH Applied Christoph Hellwig 2 participants 3 messages Jul 20 – Aug 21 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: split an assert in xfs_trans_log_buf

Split the "irst <= last && last < BBTOB(bp->b_length)" assert into two to make it clear which condition fired.

---
 fs/xfs/xfs_trans_buf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/xfs_trans_buf.c +2 -1
index 1e025848811a..a5d25b703dfc 100644
@@ -521,7 +521,8 @@ xfs_trans_log_buf(
 {
 	struct xfs_buf_log_item	*bip = bp->b_log_item;
 
-	ASSERT(first <= last && last < BBTOB(bp->b_length));
+	ASSERT(first <= last);
+	ASSERT(last < BBTOB(bp->b_length));
 	ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED));
 
 	xfs_trans_dirty_buf(tp, bp);
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Christoph Hellwig

Split the "irst <= last && last < BBTOB(bp->b_length)" assert into two to make it clear which condition fired.

---
 fs/xfs/xfs_trans_buf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/xfs_trans_buf.c +0 -0
index 1e025848811a..a5d25b703dfc 100644

fs/xfs/xfs_trans_buf.c xfs_trans_log_buf( · line 528

Quoted 9 lines
fs/xfs/xfs_trans_buf.c +2 -1
@@ -521,7 +521,8 @@ xfs_trans_log_buf(
 {
 	struct xfs_buf_log_item	*bip = bp->b_log_item;
 
-	ASSERT(first <= last && last < BBTOB(bp->b_length));
+	ASSERT(first <= last);
+	ASSERT(last < BBTOB(bp->b_length));
 	ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED));
 
 	xfs_trans_dirty_buf(tp, bp);

Ops, I think this fell through the cracks. Looks good though...

Quoted 3 lines
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

Split the "irst <= last && last < BBTOB(bp->b_length)" assert into two to make it clear which condition fired.

Applied to for-next, thanks!

[1/1] xfs: split an assert in xfs_trans_log_buf

      commit: b9b541e70d465a8c9cadf697eec7cb15b6653e7d

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>