Skip to content

Commit 11194b4

Browse files
CFSworksidryomov
authored andcommitted
libceph: reset sparse-read state in osd_fault()
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: f628d79 ("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>
1 parent e84b48d commit 11194b4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/ceph/osd_client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,6 +4281,9 @@ static void osd_fault(struct ceph_connection *con)
42814281
goto out_unlock;
42824282
}
42834283

4284+
osd->o_sparse_op_idx = -1;
4285+
ceph_init_sparse_read(&osd->o_sparse_read);
4286+
42844287
if (!reopen_osd(osd))
42854288
kick_osd_requests(osd);
42864289
maybe_request_map(osdc);

0 commit comments

Comments
 (0)