summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode-item.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-12-04 01:18:17 +0300
committerDavid Sterba <dsterba@suse.com>2022-01-07 16:18:25 +0300
commit376b91d5702f8db14beb55148039684f808e0693 (patch)
tree922f9a6b5b4cf01e5c8bc96b1b22fb01f96d8f3f /fs/btrfs/inode-item.c
parent56e1edb0e3334db479b8400abc5a9c03602e5ae8 (diff)
downloadlinux-376b91d5702f8db14beb55148039684f808e0693.tar.xz
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 <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-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;