[lustre-devel] [PATCH 12/19] lustre: ptlrpc: remove bogus LASSERT
James Simmons
jsimmons at infradead.org
Sun Nov 28 15:27:47 PST 2021
From: Andreas Dilger <adilger at whamcloud.com>
In the error case, it isn't possible for rc to be both -ENOMEM and
0 at the same time, so remove the incorrect LASSERT(rc == 0) to
avoid crashing the system on an allocation failure.
Improve error messages to conform to code style.
Fixes: c8c95f49fd73 ("lnet: me: discard struct lnet_handle_me")
WC-bug-id: https://jira.whamcloud.com/browse/LU-12678
Lustre-commit: 49769c1eea52e067d ("LU-12678 ptlrpc: remove bogus LASSERT")
Signed-off-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45421
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Chris Horn <chris.horn at hpe.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
fs/lustre/ptlrpc/niobuf.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c
index c5bbf5a..da04d4e 100644
--- a/fs/lustre/ptlrpc/niobuf.c
+++ b/fs/lustre/ptlrpc/niobuf.c
@@ -774,7 +774,7 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
struct lnet_md md;
struct lnet_me *me;
- CDEBUG(D_NET, "LNetMEAttach: portal %d\n",
+ CDEBUG(D_NET, "%s: registering portal %d\n", service->srv_name,
service->srv_req_portal);
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_RQBD))
@@ -789,8 +789,9 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
rqbd->rqbd_svcpt->scp_cpt >= 0 ?
LNET_INS_LOCAL : LNET_INS_AFTER);
if (IS_ERR(me)) {
- CERROR("LNetMEAttach failed: %ld\n", PTR_ERR(me));
- return -ENOMEM;
+ CERROR("%s: LNetMEAttach failed: rc = %ld\n",
+ service->srv_name, PTR_ERR(me));
+ return PTR_ERR(me);
}
LASSERT(rqbd->rqbd_refcount == 0);
@@ -810,9 +811,9 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
return 0;
}
- CERROR("ptlrpc: LNetMDAttach failed: rc = %d\n", rc);
+ CERROR("%s: LNetMDAttach failed: rc = %d\n", service->srv_name, rc);
LASSERT(rc == -ENOMEM);
rqbd->rqbd_refcount = 0;
- return -ENOMEM;
+ return rc;
}
--
1.8.3.1
More information about the lustre-devel
mailing list