mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-07 20:45:18 +00:00
scoutfs_btree_prev() searches prev block, not next
Oops, scoutfs_btree_prev() asked btree_walk() for the key for the next block, not the previous block to search when it's walk lands in the space before all the items in the leaf block. I saw it when truncate's check_size_eq constraint failed on items outside the range which stopped the truncate and left inodes, extents, and the orphan item around after rm -rf. Signed-off-by: Zach Brown <zab@versity.com> Reviewed-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -1406,7 +1406,7 @@ int scoutfs_btree_prev(struct super_block *sb, struct scoutfs_btree_root *root,
|
||||
ret = -ENOENT;
|
||||
while (scoutfs_key_cmp(&key, first) >= 0) {
|
||||
|
||||
bl = btree_walk(sb, root, &key, NULL, &prev_key, 0, 0, 0);
|
||||
bl = btree_walk(sb, root, &key, &prev_key, NULL, 0, 0, 0);
|
||||
if (IS_ERR(bl)) {
|
||||
ret = PTR_ERR(bl);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user