Re: [PATCH 04/13] block: Move bdi_unregister() to del_gendisk()
From: Bart Van Assche <hidden>
Date: 2017-02-22 17:42:49
From: Bart Van Assche <hidden>
Date: 2017-02-22 17:42:49
On 02/22/2017 01:20 AM, Jan Kara wrote:=0A=
On Tue 21-02-17 19:53:29, Bart Van Assche wrote:=0A=quoted
This change looks suspicious to me. There are drivers that create a=0A= block layer queue but neither call device_add_disk() nor del_gendisk(),=
=0A=
quoted
e.g. drivers/scsi/st.c. Although bdi_init() will be called for the=0A= queues created by these drivers, this patch will cause the=0A= bdi_unregister() call to be skipped for these drivers.=0A==0A= Well, the thing is that bdi_unregister() is the counterpart to=0A= bdi_register(). Unless you call bdi_register(), which happens only in=0A= device_add_disk() (and some filesystems which create their private bdis),=
=0A=
there's no point in calling bdi_unregister(). Counterpart to bdi_init() i=
s=0A=
bdi_exit() and that gets called always once bdi reference count drops to =
0.=0A= =0A= That makes sense to me. Hence:=0A= =0A= Reviewed-by: Bart Van Assche <redacted>=0A= =0A=