Correcly wrap when finding compaction entries

Compaction looks for the next entry at a given level to compact.  It
only tested for not finding a next entry when it needs to wrap the key
and start over in the level, it missed the case where the next entry is
at a greater level.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-04-18 13:44:54 -07:00
parent 930f541c7b
commit 519b9c35c4
+1 -1
View File
@@ -714,7 +714,7 @@ int scoutfs_manifest_next_compact(struct super_block *sb, void *data)
skey.level = level;
skey.seq = 0;
ment = scoutfs_treap_lookup_next(mani->treap, &skey);
if (ment == NULL && scoutfs_kvec_length(skey.key)) {
if (ment == NULL || ment->level != level) {
/* XXX ugh, these kvecs are the worst */
scoutfs_kvec_init(skey.key,
skey.key[0].iov_base, 0);