Once starting statahead thread fails, it should disable statahead.
Current code only does this when "sai != NULL", instead it should
check whether current process is opening this dir, so for cases
like current file is not the first dirent, or sai allocation fail,
it won't retry statahead.
Lustre-change: https://review.whamcloud.com/29817
Lustre-commit:
8b1bd1b88ae915c89fcbdc83abebe217a681a9e7
Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: Iaedddd3659cdffeab51800f45b02f0b39c4a1ec1
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/32366
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
lli->lli_opendir_pid);
thread = &sai->sai_thread;
if (IS_ERR(task)) {
lli->lli_opendir_pid);
thread = &sai->sai_thread;
if (IS_ERR(task)) {
+ spin_lock(&lli->lli_sa_lock);
+ lli->lli_sai = NULL;
+ spin_unlock(&lli->lli_sa_lock);
rc = PTR_ERR(task);
CERROR("can't start ll_sa thread, rc: %d\n", rc);
GOTO(out, rc);
rc = PTR_ERR(task);
CERROR("can't start ll_sa thread, rc: %d\n", rc);
GOTO(out, rc);
/* once we start statahead thread failed, disable statahead so that
* subsequent stat won't waste time to try it. */
spin_lock(&lli->lli_sa_lock);
/* once we start statahead thread failed, disable statahead so that
* subsequent stat won't waste time to try it. */
spin_lock(&lli->lli_sa_lock);
- if (sai != NULL && lli->lli_sai == sai) {
+ if (lli->lli_opendir_pid == current->pid)
- lli->lli_sai = NULL;
- }
spin_unlock(&lli->lli_sa_lock);
if (sai != NULL)
spin_unlock(&lli->lli_sa_lock);
if (sai != NULL)