From: Oleg Drokin Date: Wed, 28 Jul 2021 18:02:19 +0000 (-0400) Subject: LU-14711 osc: Do not attempt sending empty pages X-Git-Tag: 2.14.56~192 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1a409a3e6a74685970ee779ebe32917bf51eaf3a LU-14711 osc: Do not attempt sending empty pages Do not crash if trying to send a lock-prolonging emtpy read to an old server, if the server does not support short reads. Otherwise the client crashes when access the NULL page. Test-Parameters: trivial Fixes: 564070343ac4 ("LU-14711 osc: Notify server if cache discard takes a long time") Change-Id: Icae7bf3ef16c45d33894b3c5fbac15b1a98c39d9 Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/44654 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell --- diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index b80f8f4..4ca9be0 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1557,6 +1557,12 @@ retry_encrypt: !imp_connect_shortio(cli->cl_import)) short_io_size = 0; + /* If this is an empty RPC to old server, just ignore it */ + if (!short_io_size && !pga[0]->pg) { + ptlrpc_request_free(req); + RETURN(-ENODATA); + } + req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT, opc == OST_READ ? 0 : short_io_size); if (opc == OST_READ)