From: Doug Oucharek Date: Wed, 31 May 2017 21:39:12 +0000 (-0700) Subject: LU-9828 ptlrpc: Do not assert when bd_nob_transferred != 0 X-Git-Tag: 2.10.53~62 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e6490ea6cf0b793c0b47f17ac5a5fa3a2a136e0d;hp=3f86915bdfe506ac9070f091b5a1c52ed134f5d2 LU-9828 ptlrpc: Do not assert when bd_nob_transferred != 0 There is a case in the routine ptlrpc_register_bulk() where we were asserting if bd_nob_transferred != 0 when not resending. There is evidence that network errors can create a situation where this does happen. So we should not be asserting! This patch changes that assert to an error return code of -EIO. Signed-off-by: Doug Oucharek Change-Id: I6a73ca1b04a86f187744d3b8b5d46df71d95e416 Reviewed-on: https://review.whamcloud.com/28491 Reviewed-by: Dmitry Eremin Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Sonia Sharma Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 6cb29ef..9998690 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -336,8 +336,11 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req) /* cleanup the state of the bulk for it will be reused */ if (req->rq_resend || req->rq_send_state == LUSTRE_IMP_REPLAY) desc->bd_nob_transferred = 0; - else - LASSERT(desc->bd_nob_transferred == 0); + else if (desc->bd_nob_transferred != 0) + /* If the network failed after an RPC was sent, this condition + * could happen. Rather than assert (was here before), return + * an EIO error. */ + RETURN(-EIO); desc->bd_failure = 0;