From: Josef Bacik Date: Fri, 3 Dec 2021 22:18:17 +0000 (-0500) Subject: btrfs: convert BUG() for pending_del_nr into an ASSERT X-Git-Tag: baikal/aarch64/sdk6.1~4929^2~27 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=44e6edd2defe40474e17f46d4022d87f336c81a6;p=kernel.git 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 Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index 9356edb75ab4f..f7b02abb681b0 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;