]> git.baikalelectronics.ru Git - kernel.git/commit
ublk_drv: check 'current' instead of 'ubq_daemon'
authorZiyangZhang <ZiyangZhang@linux.alibaba.com>
Fri, 23 Sep 2022 15:39:13 +0000 (23:39 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 24 Sep 2022 01:09:56 +0000 (19:09 -0600)
commiteac76ae69ed70adfc699f8377805930afd4f42d8
tree761cee497cefdf8f0d64b2031241e73611af7fa1
parent79b130736507b6672c665bd4738a76dffe8e6ab4
ublk_drv: check 'current' instead of 'ubq_daemon'

This check is not atomic. So with recovery feature, ubq_daemon may be
modified simultaneously by recovery task. Instead, check 'current' is
safe here because 'current' never changes.

Also add comment explaining this check, which is really important for
understanding recovery feature.

Signed-off-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220923153919.44078-2-ZiyangZhang@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c