sd: get disk reference in sd_check_events()
authorHannes Reinecke <hare@suse.de>
Tue, 26 Apr 2016 06:06:58 +0000 (08:06 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 22 May 2016 18:53:06 +0000 (14:53 -0400)
commiteb72d0bb84eee5d0dc3044fd17b75e7101dabb57
tree746f6c67d19372ca2b336027a4e5b1f8d8be6e62
parenta621bac3044ed6f7ec5fa0326491b2d4838bfa93
sd: get disk reference in sd_check_events()

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>
drivers/scsi/sd.c