libceph: fix potential hang in ceph_osdc_notify()
authorIlya Dryomov <idryomov@gmail.com>
Tue, 1 Aug 2023 17:14:24 +0000 (19:14 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 2 Aug 2023 07:07:34 +0000 (09:07 +0200)
commite6e2843230799230fc5deb8279728a7218b0d63c
treea21e61af7751b68383c56bdcaa5f689579b5df47
parent9d01e07fd1bfb4daae156ab528aa196f5ac2b2bc
libceph: fix potential hang in ceph_osdc_notify()

If the cluster becomes unavailable, ceph_osdc_notify() may hang even
with osd_request_timeout option set because linger_notify_finish_wait()
waits for MWatchNotify NOTIFY_COMPLETE message with no associated OSD
request in flight -- it's completely asynchronous.

Introduce an additional timeout, derived from the specified notify
timeout.  While at it, switch both waits to killable which is more
correct.

Cc: stable@vger.kernel.org
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
net/ceph/osd_client.c