[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201210142603.516070160@linuxfoundation.org>
Date: Thu, 10 Dec 2020 15:27:07 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Sergei Shtepa <sergei.shtepa@...am.com>,
Mike Snitzer <snitzer@...hat.com>
Subject: [PATCH 5.4 30/54] dm: fix bug with RCU locking in dm_blk_report_zones
From: Sergei Shtepa <sergei.shtepa@...am.com>
commit 89478335718c98557f10470a9bc5c555b9261c4e upstream.
The dm_get_live_table() function makes RCU read lock so
dm_put_live_table() must be called even if dm_table map is not found.
Fixes: e76239a3748c9 ("block: add a report_zones method")
Cc: stable@...r.kernel.org
Signed-off-by: Sergei Shtepa <sergei.shtepa@...am.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/md/dm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -455,8 +455,10 @@ static int dm_blk_report_zones(struct ge
return -EAGAIN;
map = dm_get_live_table(md, &srcu_idx);
- if (!map)
- return -EIO;
+ if (!map) {
+ ret = -EIO;
+ goto out;
+ }
tgt = dm_table_find_target(map, sector);
if (!tgt) {
Powered by blists - more mailing lists