[lustre-devel] [PATCH 10/20] lustre: osc: Do not attempt sending empty pages

James Simmons jsimmons at infradead.org
Mon Oct 11 10:40:39 PDT 2021


From: Oleg Drokin <green at whamcloud.com>

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.

Fixes: 1febc3615e2b ("lustre: osc: Notify server if cache discard takes a long time")
WC-bug-id: https://jira.whamcloud.com/browse/LU-14711
Lustre-commit: 1a409a3e6a7468597 ("LU-14711 osc: Do not attempt sending empty pages")
Signed-off-by: Oleg Drokin <green at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44654
Reviewed-by: Patrick Farrell <pfarrell at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/osc/osc_request.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index def2ee7..e5b7453 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -1567,6 +1567,12 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
 	    !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)
-- 
1.8.3.1



More information about the lustre-devel mailing list