X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fstatahead.c;h=4022398a4fe927493b3da77afd443ad8b47b5413;hb=8b1bd1b88ae915c89fcbdc83abebe217a681a9e7;hp=44cc9e681b59e92311c275fe9e140bb3d6e01fd9;hpb=ebb01c9421a8007a34b69eb972aab45369446b23;p=fs%2Flustre-release.git diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index 44cc9e6..4022398 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1588,6 +1588,9 @@ static int start_statahead_thread(struct inode *dir, struct dentry *dentry) 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); @@ -1608,10 +1611,8 @@ out: /* 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_sa_enabled = 0; - lli->lli_sai = NULL; - } spin_unlock(&lli->lli_sa_lock); if (sai != NULL)