From 4db0a48fe4b4e1dc4bcc7a18bd9c496cb4067e91 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 29 Apr 2026 10:02:43 -0700 Subject: [PATCH] Search all merge range items for next When searching for the next least merge range we need to sweep all the stored items because they're interleaved with respect to key sorting because we've clobbered the zone. To search all of them we need to start from 0, not from the caller's start key after setting the zone. If the caller happens to provide a start key with a small zone but large other fields (totl keys with sufficiently large identifiers) we can miss ranges. Signed-off-by: Zach Brown --- kmod/src/server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kmod/src/server.c b/kmod/src/server.c index e4791980..ddf405b8 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -1077,8 +1077,7 @@ static int next_log_merge_range(struct super_block *sb, struct scoutfs_btree_roo struct scoutfs_key key; int ret; - key = *start; - key.sk_zone = SCOUTFS_LOG_MERGE_RANGE_ZONE; + init_log_merge_key(&key, SCOUTFS_LOG_MERGE_RANGE_ZONE, 0, 0); scoutfs_key_set_ones(&rng->start); do {