]> 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)
commit0f863c8947985ceff1cf10b31bf29c13776f5861
tree62b1d3e75ba06f46593883beb0ef48ac684907a3
parent5d6020e856a216174c1b30ca401d660207799dee
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 c268adca ("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