]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: support timeout in rbd_wait_state_locked()
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Mon, 26 Mar 2018 14:22:55 +0000 (10:22 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Apr 2018 07:38:40 +0000 (09:38 +0200)
commit4e8178f358698be4aa57260828b89776fd1f74cf
treec4421bd5aa961599e55a35a0151f18b528c9f8d6
parent35f57288580bbd19434ae4c0c5318b378922f5bd
rbd: support timeout in rbd_wait_state_locked()

currently, the rbd_wait_state_locked() will wait forever if we
can't get our state locked. Example:

rbd map --exclusive test1  --> /dev/rbd0
rbd map test1  --> /dev/rbd1
dd if=/dev/zero of=/dev/rbd1 bs=1M count=1 --> IO blocked

To avoid this problem, this patch introduce a timeout design
in rbd_wait_state_locked(). Then rbd_wait_state_locked() will
return error when we reach a timeout.

This patch allow user to set the lock_timeout in rbd mapping.

Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c