[SCSI] add refcouting around ctask usage in main IO patch
authorMike Christie <michaelc@cs.wisc.edu>
Thu, 31 Aug 2006 22:09:25 +0000 (18:09 -0400)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 2 Sep 2006 18:37:07 +0000 (13:37 -0500)
commit60ecebf5a10e42f5e2d6e07eb9e24bdee8500b81
tree79b27fd89fe175daa4e4cd6feda8a6548c6d9bf1
parentffd0436ed2e5a741c8d30062b489b989acf0a526
[SCSI] add refcouting around ctask usage in main IO patch

It is possible that a ctask could be completing and getting
cleaned up at the same time, we are finishing up the last
data transfer. This could then result in the data transfer
code using stale or invalid values. This patch adds a refcount
to the ctask. When the count goes to zero then we know the
transmit thread and recv thread or softirq are not touching
it and we can safely release it.

The eh should not need to grab a reference because it only cleans
up a task if it has both the xmit mutex and recv lock (or recv
side suspended).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libiscsi.c
include/scsi/libiscsi.h