]> git.ipfire.org Git - people/arne_f/kernel.git/commit
sd: get disk reference in sd_check_events()
authorHannes Reinecke <hare@suse.de>
Tue, 26 Apr 2016 06:06:58 +0000 (08:06 +0200)
committerJiri Slaby <jslaby@suse.cz>
Mon, 13 Mar 2017 20:40:28 +0000 (21:40 +0100)
commit281ccab8eaf7d1d6b18d9ebf34288ada0299720e
tree41c3abb01f1513ed6e7f35279adb5b8314406564
parentfc7b773166d00859060d91fdf9d017619f07184c
sd: get disk reference in sd_check_events()

commit eb72d0bb84eee5d0dc3044fd17b75e7101dabb57 upstream.

sd_check_events() is called asynchronously, and might race
with device removal. So always take a disk reference when
processing the event to avoid the device being removed while
the event is processed.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Jinpu Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/sd.c