Whamcloud - gitweb
LU-17929 ptlrpc: ptlrpc_request_alloc_pack() always returns an error code 91/55391/6
authorAurelien Degremont <adegremont@nvidia.com>
Tue, 11 Jun 2024 08:33:11 +0000 (10:33 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2024 03:31:38 +0000 (03:31 +0000)
commitfc00b7e3d1bbb6ad390c5d69a73353cb7b61960a
treea98d285017ca47e4328bafa10bd0eba3203ad24c
parent9435453d796571fdaedac398a82e1302d55727ec
LU-17929 ptlrpc: ptlrpc_request_alloc_pack() always returns an error code

Current code was always considering that when this function
returns NULL it meant ENOMEM error, but this is not always
true, especially when using GSS by example, or when
reconnecting from an IDLE state.
Also, instead of having every caller converting NULL to
ENOMEM, do that directly in the function when
appropriate.

Make ptlrpc_request_alloc_pack() return -errno in case
of error instead of a NULL pointer.

Thanks to that change, error code will be propagated up
and will help error reporting and debugging.

Took the opportunity to simplify related error path
for 2 HSM functions.

Also changed param.status to a signed data, as it can
store -errno.

Signed-off-by: Aurelien Degremont <adegremont@nvidia.com>
Change-Id: Id2b873d5f0c5cb89db070f6db00269545e6c85e8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55391
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lustre/fid/fid_request.c
lustre/fld/fld_request.c
lustre/include/uapi/linux/lustre/lgss.h
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c
lustre/mdc/mdc_request.c
lustre/mgc/mgc_request.c
lustre/osc/osc_quota.c
lustre/ptlrpc/client.c
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/import.c
lustre/ptlrpc/llog_client.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/pinger.c