From 8c5b09aee8177c312b9243d612b79e9c8f780f23 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 21 Jul 2025 18:16:54 -0400 Subject: [PATCH] Prevent masking away inconsistent state in search_sorted_file. In these two error conditions we explicitly set `ret = -EIO` but then `break` to set `ret = 0` immediately again, masking away a critical error code that should be returned. Instead, `goto out` retains the EIO error value for the caller. Signed-off-by: Auke Kok --- kmod/src/srch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmod/src/srch.c b/kmod/src/srch.c index 17f482e2..f051d374 100644 --- a/kmod/src/srch.c +++ b/kmod/src/srch.c @@ -856,14 +856,14 @@ static int search_sorted_file(struct super_block *sb, if (pos > SCOUTFS_SRCH_BLOCK_SAFE_BYTES) { /* can only be inconsistency :/ */ ret = -EIO; - break; + goto out; } ret = decode_entry(srb->entries + pos, &sre, &prev); if (ret <= 0) { /* can only be inconsistency :/ */ ret = -EIO; - break; + goto out; } pos += ret; prev = sre;