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 <>
Signed-off-by: Christoph Hellwig <>
Reviewed-by: Jan Kara <>
Reviewed-by: Bart Van Assche <>
Signed-off-by: Jens Axboe <>
2 files changed