Commit 89478335 authored by Sergei Shtepa's avatar Sergei Shtepa Committed by Mike Snitzer

dm: fix bug with RCU locking in dm_blk_report_zones

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: e76239a3 ("block: add a report_zones method")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSergei Shtepa <sergei.shtepa@veeam.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 35d2835d
......@@ -476,8 +476,10 @@ static int dm_blk_report_zones(struct gendisk *disk, sector_t sector,
return -EAGAIN;
map = dm_get_live_table(md, &srcu_idx);
if (!map)
return -EIO;
if (!map) {
ret = -EIO;
goto out;
}
do {
struct dm_target *tgt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment