]> git.baikalelectronics.ru Git - kernel.git/commit
[S390] dasd: fix race between tasklet and dasd_sleep_on
authorStefan Weinhuber <wein@de.ibm.com>
Wed, 12 May 2010 07:32:11 +0000 (09:32 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Wed, 12 May 2010 07:32:26 +0000 (09:32 +0200)
commitdfbe50be71e5cba7b20339822d7dc6308bb419fd
treea3970653539aa4a9b71536a204efbe7d5ba8ff07
parenta797ff15e7b19d529c30b26b42d6a5926c567e8f
[S390] dasd: fix race between tasklet and dasd_sleep_on

The various dasd_sleep_on functions use a global wait queue when
waiting for a cqr. The wait condition checks the status and devlist
fields of the cqr to determine if it is safe to continue. This
evaluation may return true, although the tasklet has not finished
processing of the cqr and the callback function has not been called
yet. When the callback is finally called, the data in the cqr may
already be invalid. The sleep_on wait condition needs a safe way to
determine if the tasklet has finished processing. Use the
callback_data field of the cqr to store a token, which is set by
the callback function itself.

Cc: <stable@kernel.org>
Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c