scoutfs: fix srch btree iref puts

The srch code was putting btree item refs outside of success.  This is
fine, but they only need to be put when btree ops return success and
have set the reference.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-12-03 09:58:35 -08:00
committed by Andy Grover
parent 1bef610416
commit 4647a6ccb2
+2 -2
View File
@@ -964,8 +964,8 @@ retry:
} else {
ret = -EIO;
}
scoutfs_btree_put_iref(&iref);
}
scoutfs_btree_put_iref(&iref);
if (ret < 0) {
if (ret == -ENOENT) {
if (key.sk_type == SCOUTFS_SRCH_BLOCKS_TYPE) {
@@ -999,8 +999,8 @@ retry:
} else {
ret = -EIO;
}
scoutfs_btree_put_iref(&iref);
}
scoutfs_btree_put_iref(&iref);
if (ret < 0)
goto out;