From: Ian Kent The correction to not make a dentry negative has an error. Currently ->lookup() checks if an expire is in progress and removes the entry from the list, before the expire is complete so if more than one process is performing a lookup at this time only one will wait for expire completion. We need to not remove the list entry until after waiting for expire completion. Signed-off-by: Ian Kent Signed-off-by: Andrew Morton --- fs/autofs4/root.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN fs/autofs4/root.c~autofs4-dont-make-expiring-dentry-negative-fix fs/autofs4/root.c --- a/fs/autofs4/root.c~autofs4-dont-make-expiring-dentry-negative-fix +++ a/fs/autofs4/root.c @@ -555,7 +555,6 @@ static struct dentry *autofs4_lookup_exp goto next; if (d_unhashed(dentry)) { - list_del_init(&ino->expiring); dget(dentry); spin_unlock(&dentry->d_lock); spin_unlock(&sbi->lookup_lock); @@ -606,6 +605,10 @@ static struct dentry *autofs4_lookup(str autofs4_wait(sbi, expiring, NFY_NONE); DPRINTK("request completed"); } + spin_lock(&sbi->lookup_lock); + if (!list_empty(&ino->expiring)) + list_del_init(&ino->expiring); + spin_unlock(&sbi->lookup_lock); dput(expiring); } _