From: Hongchao Zhang Date: Thu, 17 Nov 2011 02:47:00 +0000 (+0800) Subject: LU-837 release semaphore for error case in gss_do_ctx_init_rpc X-Git-Tag: 2.1.53~28 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8003be0425c37fca66e463781a02e37be5fb2c7e LU-837 release semaphore for error case in gss_do_ctx_init_rpc in gss_do_ctx_init_rpc, the r/w lock "obd->u.cli.cl_sem" is not released if the obd->u.cli.cl_import is NULL and returns error. Change-Id: Ib9bb4d4cb79adabe8ff661b9b4a7f6df5963d4ff Signed-off-by: Hongchao Zhang Reviewed-on: http://review.whamcloud.com/1705 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/gss/gss_cli_upcall.c b/lustre/ptlrpc/gss/gss_cli_upcall.c index eb9536b..80d5591 100644 --- a/lustre/ptlrpc/gss/gss_cli_upcall.c +++ b/lustre/ptlrpc/gss/gss_cli_upcall.c @@ -299,6 +299,7 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count) cfs_down_read(&obd->u.cli.cl_sem); if (obd->u.cli.cl_import == NULL) { CERROR("obd %s: import has gone\n", obd->obd_name); + cfs_up_read(&obd->u.cli.cl_sem); RETURN(-EINVAL); } imp = class_import_get(obd->u.cli.cl_import);