Whamcloud - gitweb
LU-2388 statahead: don't statahead if it's stopped
authorLai Siyao <laisiyao@whamcloud.com>
Fri, 30 Nov 2012 07:45:55 +0000 (15:45 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Dec 2012 06:40:34 +0000 (01:40 -0500)
Statahead may be stopped but lli->lli_sai is not NULL(inflight
statahead RPCs), so check lli->lli_opendir_key before accessing
statahead data.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I4bcd4da0dc2913697473bf85ff6e502df43ce5a2
Reviewed-on: http://review.whamcloud.com/4718
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/llite_internal.h

index ea34779..c8f0f3b 100644 (file)
@@ -1298,6 +1298,10 @@ ll_statahead_enter(struct inode *dir, struct dentry **dentryp, int only_unplug)
         if (lli->lli_opendir_pid != cfs_curproc_pid())
                 return -EAGAIN;
 
         if (lli->lli_opendir_pid != cfs_curproc_pid())
                 return -EAGAIN;
 
+       /* statahead has been stopped */
+       if (lli->lli_opendir_key == NULL)
+               return -EAGAIN;
+
         ldd = ll_d2d(*dentryp);
         /*
          * When stats a dentry, the system trigger more than once "revalidate"
         ldd = ll_d2d(*dentryp);
         /*
          * When stats a dentry, the system trigger more than once "revalidate"