blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

disk_get_part needs to be paired with a disk_put_part.

Cc: stable@vger.kernel.org
Fixes: ef45fe470e ("blk-cgroup: show global disk stats in root cgroup io.stat")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2020-11-14 19:12:46 +01:00 committed by Jens Axboe
parent 9f16a66733
commit b7131ee0ba

View File

@ -849,6 +849,7 @@ static void blkcg_fill_root_iostats(void)
blkg_iostat_set(&blkg->iostat.cur, &tmp); blkg_iostat_set(&blkg->iostat.cur, &tmp);
u64_stats_update_end(&blkg->iostat.sync); u64_stats_update_end(&blkg->iostat.sync);
} }
disk_put_part(part);
} }
} }