aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2021-12-03 17:18:17 -0500
committerDavid Sterba <[email protected]>2022-01-07 14:18:25 +0100
commit376b91d5702f8db14beb55148039684f808e0693 (patch)
tree922f9a6b5b4cf01e5c8bc96b1b22fb01f96d8f3f
parent56e1edb0e3334db479b8400abc5a9c03602e5ae8 (diff)
btrfs: convert BUG() for pending_del_nr into an ASSERT
This is a logic correctness check, convert it into an ASSERT() instead of a BUG(). Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
-rw-r--r--fs/btrfs/inode-item.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 9356edb75ab4..f7b02abb681b 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -651,6 +651,9 @@ delete:
else
control->last_size = new_size;
if (del_item) {
+ ASSERT(!pending_del_nr ||
+ ((path->slots[0] + 1) == pending_del_slot));
+
if (!pending_del_nr) {
/* No pending yet, add ourselves */
pending_del_slot = path->slots[0];
@@ -660,8 +663,6 @@ delete:
/* Hop on the pending chunk */
pending_del_nr++;
pending_del_slot = path->slots[0];
- } else {
- BUG();
}
} else {
break;