From 4647a6ccb20a31cf1900f5313110659664ab94ba Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 16 Nov 2020 15:44:53 -0800 Subject: [PATCH] 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 --- kmod/src/srch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmod/src/srch.c b/kmod/src/srch.c index 856d0efd..efe66021 100644 --- a/kmod/src/srch.c +++ b/kmod/src/srch.c @@ -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;