mirror-linux/net/ceph
Ilya Dryomov c0fe2994f9 libceph: make calc_target() set t->paused, not just clear it
Currently calc_target() clears t->paused if the request shouldn't be
paused anymore, but doesn't ever set t->paused even though it's able to
determine when the request should be paused.  Setting t->paused is left
to __submit_request() which is fine for regular requests but doesn't
work for linger requests -- since __submit_request() doesn't operate
on linger requests, there is nowhere for lreq->t.paused to be set.
One consequence of this is that watches don't get reestablished on
paused -> unpaused transitions in cases where requests have been paused
long enough for the (paused) unwatch request to time out and for the
subsequent (re)watch request to enter the paused state.  On top of the
watch not getting reestablished, rbd_reregister_watch() gets stuck with
rbd_dev->watch_mutex held:

  rbd_register_watch
    __rbd_register_watch
      ceph_osdc_watch
        linger_reg_commit_wait

It's waiting for lreq->reg_commit_wait to be completed, but for that to
happen the respective request needs to end up on need_resend_linger list
and be kicked when requests are unpaused.  There is no chance for that
if the request in question is never marked paused in the first place.

The fact that rbd_dev->watch_mutex remains taken out forever then
prevents the image from getting unmapped -- "rbd unmap" would inevitably
hang in D state on an attempt to grab the mutex.

Cc: stable@vger.kernel.org
Reported-by: Raphael Zimmer <raphael.zimmer@tu-ilmenau.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
2026-01-06 00:39:43 +01:00
..
crush libceph: fix crush_choose_firstn() kernel-doc warnings 2024-07-11 16:33:07 +02:00
Kconfig libceph: Use HMAC-SHA256 library instead of crypto_shash 2025-10-08 23:30:45 +02:00
Makefile
armor.c
auth.c libceph: remove unnecessary ret variable in ceph_auth_init() 2021-06-28 23:49:25 +02:00
auth_none.c
auth_none.h
auth_x.c libceph: prevent potential out-of-bounds writes in handle_auth_session_key() 2025-11-27 09:59:49 +01:00
auth_x.h
auth_x_protocol.h
buffer.c mm: allow !GFP_KERNEL allocations for kvmalloc 2022-01-15 16:30:29 +02:00
ceph_common.c libceph: drop started parameter of __ceph_open_session() 2025-11-26 23:29:11 +01:00
ceph_hash.c
ceph_strings.c
cls_lock_client.c libceph: fix doc warnings in cls_lock_client.c 2021-06-28 23:49:25 +02:00
crypto.c libceph: Remove unused ceph_crypto_key_encode 2024-11-18 17:34:35 +01:00
crypto.h libceph: Remove unused ceph_crypto_key_encode 2024-11-18 17:34:35 +01:00
debugfs.c libceph: fix potential use-after-free in have_mon_and_osd_map() 2025-11-26 23:29:10 +01:00
decode.c
messenger.c net: Convert proto_ops connect() callbacks to use sockaddr_unsized 2025-11-04 19:10:32 -08:00
messenger_v1.c libceph: add empty check to ceph_con_get_out_msg() 2025-10-08 23:30:47 +02:00
messenger_v2.c libceph: prevent potential out-of-bounds reads in handle_auth_done() 2026-01-05 13:28:25 +01:00
mon_client.c libceph: return the handler error from mon_handle_auth_done() 2026-01-05 22:46:43 +01:00
msgpool.c
osd_client.c libceph: make calc_target() set t->paused, not just clear it 2026-01-06 00:39:43 +01:00
osdmap.c libceph: make free_choose_arg_map() resilient to partial allocation 2026-01-05 13:28:26 +01:00
pagelist.c libceph: Remove unused ceph_pagelist functions 2024-11-18 17:34:35 +01:00
pagevec.c libceph: Remove unused pagevec functions 2024-11-18 17:34:35 +01:00
snapshot.c
string_table.c
striper.c