On 3 Jan 2020, at 12:15, Theodore Y. Ts'o wrote: > On Fri, Dec 27, 2019 at 07:52:11PM -0500, Theodore Ts'o wrote: >> >> Fortunately, it looks like the rest of the writeback path is >> perfectly >> happy with bdi->dev and bdi->owner being NULL, so the simplest fix is >> to create a bdi_dev_name() function which can handle bdi->dev being >> NULL. This also allows us to bulletproof the writeback tracepoints >> to >> prevent them from dereferencing a NULL pointer and crashing the >> kernel >> if one is tracing with memcg's enabled, and an iSCSI device dies or a >> USB storage stick is pulled. >> >> Previous-Version-Link: >> https://lore.kernel.org/r/20191227194829.150110-1-tytso@xxxxxxx >> Google-Bug-Id: 145475544 >> Tested: fs smoke test >> Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> >> --- >> >> Notes: >> v2: add #include for linux/device.h >> >> fs/fs-writeback.c | 2 +- >> include/linux/backing-dev.h | 10 +++++++++ >> include/trace/events/writeback.h | 37 >> +++++++++++++++----------------- >> mm/backing-dev.c | 1 + >> 4 files changed, 29 insertions(+), 21 deletions(-) > > Ping? > > Any comments? Any objections if I carry this patch[1] in the ext4 > tree? Or would it be better for Andrew to carry it in the linux-mm > tree? > > [1] https://lore.kernel.org/k/20191227203117.152399-1-tytso@xxxxxxx Seems sane to me, and we probably want this even if del_gendisk() embraces the brave new memcg world because synchronizing all of this is going to get messy. -chris