Whamcloud - gitweb
LU-2737 osc: double unlock in osc_lru_shrink()
authorNiu Yawei <niu@whamcloud.com>
Mon, 4 Feb 2013 03:49:26 +0000 (22:49 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 5 Feb 2013 21:39:37 +0000 (16:39 -0500)
It could unlock twice in osc_lru_shrink() if the cl_io_init() failed.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Idf3ebafced7f7d3a68c13ea20d12cf221e9d74ce
Reviewed-on: http://review.whamcloud.com/5258
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osc/osc_page.c

index 75e6108..5c6102a 100644 (file)
@@ -718,11 +718,13 @@ int osc_lru_shrink(struct client_obd *cli, int target)
                        clobj = tmp;
                        io->ci_obj = clobj;
                        rc = cl_io_init(env, io, CIT_MISC, clobj);
+
+                       client_obd_list_lock(&cli->cl_lru_list_lock);
+
                        if (rc != 0)
                                break;
 
                        ++maxscan;
-                       client_obd_list_lock(&cli->cl_lru_list_lock);
                        continue;
                }