nbd: protect cmd->status with cmd->lock
authorJosef Bacik <josef@toxicpanda.com>
Mon, 21 Oct 2019 19:56:27 +0000 (15:56 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 25 Oct 2019 20:20:01 +0000 (14:20 -0600)
commitde6346ecbc8f5591ebd6c44ac164e8b8671d71d7
tree29206df9d14ff000d222bfa0c25c574e5917a1bb
parent2b2ed9750fc9d040b9f6d076afcef6f00b6f1f7c
nbd: protect cmd->status with cmd->lock

We already do this for the most part, except in timeout and clear_req.
For the timeout case we take the lock after we grab a ref on the config,
but that isn't really necessary because we're safe to touch the cmd at
this point, so just move the order around.

For the clear_req cause this is initiated by the user, so again is safe.

Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c