Whamcloud - gitweb
LU-837 release semaphore for error case in gss_do_ctx_init_rpc
authorHongchao Zhang <hongchao.zhang@whamcloud.com>
Thu, 17 Nov 2011 02:47:00 +0000 (10:47 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Dec 2011 18:22:15 +0000 (13:22 -0500)
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 <hongchao.zhang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1705
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/gss/gss_cli_upcall.c

index eb9536b..80d5591 100644 (file)
@@ -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);