From bb12921b8af7a101f50c08f94807a3238fc01566 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 15 Mar 2024 00:07:40 +0100 Subject: [PATCH] btrfs-progs: handle btfs_del_items() failure in truncate_free_ino_items() Do proper error handling like in the rest of the function. Signed-off-by: David Sterba --- common/clear-cache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/clear-cache.c b/common/clear-cache.c index d57313b7..960c3466 100644 --- a/common/clear-cache.c +++ b/common/clear-cache.c @@ -542,7 +542,11 @@ int truncate_free_ino_items(struct btrfs_root *root) } ret = btrfs_del_item(trans, root, &path); - BUG_ON(ret); + if (ret < 0) { + btrfs_abort_transaction(trans, ret); + btrfs_release_path(&path); + goto out; + } btrfs_release_path(&path); }