]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: proper state checking and module refcount handling in scsi_device_get
authorChristoph Hellwig <hch@lst.de>
Mon, 2 Feb 2015 13:01:26 +0000 (14:01 +0100)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 19 Mar 2015 13:43:15 +0000 (06:43 -0700)
commitcdd619addc26fe8b39e2181f6677dd4abee3d597
tree62b1d3e75ba06f46593883beb0ef48ac684907a3
parentf331a9556496a5ab8c16e782d1a9a8bcd7dc93af
scsi: proper state checking and module refcount handling in scsi_device_get

This effectively reverts commits 85b6c7 ("[SCSI] sd: fix cache flushing on
module removal (and individual device removal)" and 4283831d ("scsi: always
increment reference count").

We now never call scsi_device_get from the shutdown path, and the fact
that we started grabbing reference there in commit 85b6c7 turned out
turned out to create more problems than it solves, and required
workarounds for workarounds for workarounds. Move back to properly checking
the device state and carefully handle module refcounting.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi.c