]> 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)
commitdba86fe0f2cb50a26a5c1e7425ece15de8f1344b
tree761cee497cefdf8f0d64b2031241e73611af7fa1
parent424411c6f7dc151ae13527f13ecfb6ca79a22aa5
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