From 5f0c87970c9faa6104d5104b18f0448692ffc09a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 4 May 2018 16:31:36 -0700 Subject: [PATCH] scoutfs: fix level 0 key iteration increment Compaction has to find the oldest level 0 segment for compaction. It iterates over the level 0 segments by their manifest entry's btree key. It was incorrectly incrementing the btree search key. It was incrementing the first key stored in the entry, but that's not the least significant field. The seq is the least significant field so this iteration could skip over segments written at different times with the same first key. The fix to have it visit all the entries is to increment the lowest precision seq field. Right now we have a single level 0 segment so this code never actually matters. Signed-off-by: Zach Brown --- kmod/src/manifest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kmod/src/manifest.c b/kmod/src/manifest.c index bc5d5d42..5ecd9f61 100644 --- a/kmod/src/manifest.c +++ b/kmod/src/manifest.c @@ -971,8 +971,7 @@ int scoutfs_manifest_next_compact(struct super_block *sb, void *data) if (next.seq < ment.seq) ment = next; - scoutfs_key_inc(&next.first); - init_btree_key(&mkey, next.level, next.seq, + init_btree_key(&mkey, next.level, next.seq + 1, &next.first); }