diff mbox series

[02/14] btrfs: update comment and drop assertion in extent item lookup in find_parent_nodes()

Message ID 58769dbf1265749659b64af427acc19487c3ae60.1707382595.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series More error handling and BUG_ON cleanups | expand

Commit Message

David Sterba Feb. 8, 2024, 8:59 a.m. UTC
Same comment was added to this type of error, unify that and drop the
assertion as we'd find out quickly that something is wrong after
returning -EUCLEAN.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/backref.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index beed7e459dab..0fa27ed802f6 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1435,8 +1435,10 @@  static int find_parent_nodes(struct btrfs_backref_walk_ctx *ctx,
 	if (ret < 0)
 		goto out;
 	if (ret == 0) {
-		/* This shouldn't happen, indicates a bug or fs corruption. */
-		ASSERT(ret != 0);
+		/*
+		 * Key with offset -1 found, there would have to exist an extent
+		 * item with such offset, but this is out of the valid range.
+		 */
 		ret = -EUCLEAN;
 		goto out;
 	}