• Stefan Weinhuber's avatar
    [S390] dasd: fix race between tasklet and dasd_sleep_on · 1c1e093c
    Stefan Weinhuber authored
    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: default avatarStefan Weinhuber <wein@de.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    1c1e093c
dasd.c 74.8 KB