diff mbox series

dm space map metadata: Fix lost checking the return value of the 'apply_bops'.

Message ID 1566185481-56934-1-git-send-email-zhangxiaoxu5@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series dm space map metadata: Fix lost checking the return value of the 'apply_bops'. | expand

Commit Message

Zhang Xiaoxu Aug. 19, 2019, 3:31 a.m. UTC
In commit 6096d91af0b6 ("dm space map metadata: fix occasional leak
of a metadata block on resize"), we refactor the commit logical to
a new function 'apply_bops'.

But when replace it in 'out' function, the return value was not checked.
This may lead 'out' function return a wrong value to the caller.

Fixes: 6096d91af0b6 ("dm space map metadata: fix occasional leak of a
metadata block on resize")
Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
---
 drivers/md/persistent-data/dm-space-map-metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
index aec4492..2532858 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.c
+++ b/drivers/md/persistent-data/dm-space-map-metadata.c
@@ -249,7 +249,7 @@  static int out(struct sm_metadata *smm)
 	}
 
 	if (smm->recursion_count == 1)
-		apply_bops(smm);
+		r = apply_bops(smm);
 
 	smm->recursion_count--;