bdi: add a ->dev_name field to struct backing_dev_info
authorChristoph Hellwig <hch@lst.de>
Mon, 4 May 2020 12:47:56 +0000 (14:47 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:07:57 +0000 (16:07 -0600)
commit6bd87eec23cbc9ed222bed0f5b5b02bf300e9a8d
tree27ebe54b5fbc4083760df21ddd65d6d3ecc17dbd
parentd51cfc53ade3189455a1b88ec7a2ff0c24597cf8
bdi: add a ->dev_name field to struct backing_dev_info

Cache a copy of the name for the life time of the backing_dev_info
structure so that we can reference it even after unregistering.

Fixes: 68f23b89067f ("memcg: fix a crash in wb_workfn when a device disappears")
Reported-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/backing-dev-defs.h
mm/backing-dev.c