summaryrefslogtreecommitdiff
path: root/net/ceph
diff options
context:
space:
mode:
authorSam Edwards <cfsworks@gmail.com>2025-12-30 20:05:06 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-17 16:35:15 +0100
commit10b7c72810364226f7b27916ea3e2a4f870bc04b (patch)
tree2c171e99d29d13b57e5ce15272ba48118af6c269 /net/ceph
parent9e0101e57534ef0e7578dd09608a6106736b82e5 (diff)
libceph: reset sparse-read state in osd_fault()
commit 11194b416ef95012c2cfe5f546d71af07b639e93 upstream. When a fault occurs, the connection is abandoned, reestablished, and any pending operations are retried. The OSD client tracks the progress of a sparse-read reply using a separate state machine, largely independent of the messenger's state. If a connection is lost mid-payload or the sparse-read state machine returns an error, the sparse-read state is not reset. The OSD client will then interpret the beginning of a new reply as the continuation of the old one. If this makes the sparse-read machinery enter a failure state, it may never recover, producing loops like: libceph: [0] got 0 extents libceph: data len 142248331 != extent len 0 libceph: osd0 (1)...:6801 socket error on read libceph: data len 142248331 != extent len 0 libceph: osd0 (1)...:6801 socket error on read Therefore, reset the sparse-read state in osd_fault(), ensuring retries start from a clean state. Cc: stable@vger.kernel.org Fixes: f628d7999727 ("libceph: add sparse read support to OSD client") Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osd_client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 6664ea73ccf8..67f7430c7750 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -4283,6 +4283,9 @@ static void osd_fault(struct ceph_connection *con)
goto out_unlock;
}
+ osd->o_sparse_op_idx = -1;
+ ceph_init_sparse_read(&osd->o_sparse_read);
+
if (!reopen_osd(osd))
kick_osd_requests(osd);
maybe_request_map(osdc);