Whamcloud - gitweb
LU-2940 llite: Fix for oops in vvp_pgcache_show() 92/7192/2
authorSwapnil Pimpale <spimpale@ddn.com>
Wed, 31 Jul 2013 12:07:25 +0000 (17:37 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 10 Aug 2013 04:06:59 +0000 (04:06 +0000)
Hold the lock protecting page tree (coh_page_guard) till the point the page is
being accessed.

Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Change-Id: I9d1d5129d9cac8f1fa5eec77f554320c0c255fc2
Reviewed-on: http://review.whamcloud.com/7192
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/vvp_dev.c

index c0a636d..68ea741 100644 (file)
@@ -453,7 +453,6 @@ static int vvp_pgcache_show(struct seq_file *f, void *v)
 
                        spin_lock(&hdr->coh_page_guard);
                        page = cl_page_lookup(hdr, id.vpi_index);
-                       spin_unlock(&hdr->coh_page_guard);
 
                         seq_printf(f, "%8x@"DFID": ",
                                    id.vpi_index, PFID(&hdr->coh_lu.loh_fid));
@@ -462,6 +461,7 @@ static int vvp_pgcache_show(struct seq_file *f, void *v)
                                 cl_page_put(env, page);
                         } else
                                 seq_puts(f, "missing\n");
+                       spin_unlock(&hdr->coh_page_guard);
                         lu_object_ref_del(&clob->co_lu, "dump", cfs_current());
                         cl_object_put(env, clob);
                 } else