From: Dongsheng Yang Date: Wed, 11 Apr 2018 02:28:15 +0000 (-0400) Subject: rbd: support lock_timeout in rbd mapping X-Git-Tag: v13.1.0~196^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b09e4fe58487b8c2027f764190dfb553e73a17bb;p=ceph.git rbd: support lock_timeout in rbd mapping Signed-off-by: Dongsheng Yang --- diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index 623e0ddfdd9..eca1d6d93e1 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -647,6 +647,9 @@ Per client instance `rbd device map` options: since 4.2 this can be used to ensure that `rbd device unmap` eventually times out when there is no network connection to a cluster. +* lock_timeout=x - A timeout on waiting for the acquisition of exclusive lock + (since 4.17, default is 0 seconds, meaning no timeout). + * osdkeepalive=x - OSD keepalive timeout (default is 5 seconds). * osd_idle_ttl=x - OSD idle TTL (default is 60 seconds). diff --git a/src/tools/rbd/action/Kernel.cc b/src/tools/rbd/action/Kernel.cc index cbcff9c76a3..bc8e583d848 100644 --- a/src/tools/rbd/action/Kernel.cc +++ b/src/tools/rbd/action/Kernel.cc @@ -128,6 +128,9 @@ static int parse_map_options(const std::string &options_string) } else if (!strcmp(this_char, "osd_request_timeout")) { if (put_map_option_value("osd_request_timeout", value_char, map_option_int_cb)) return -EINVAL; + } else if (!strcmp(this_char, "lock_timeout")) { + if (put_map_option_value("lock_timeout", value_char, map_option_int_cb)) + return -EINVAL; } else if (!strcmp(this_char, "osdkeepalive")) { if (put_map_option_value("osdkeepalive", value_char, map_option_int_cb)) return -EINVAL;