From: Ian Kent <raven@themaw.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: autofs mailing list <autofs@linux.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/5] autofs4 - dont make expiring dentry negative fix
Date: Tue, 01 Jul 2008 17:25:58 +0800 [thread overview]
Message-ID: <20080701092557.12041.32586.stgit@raven.themaw.net> (raw)
In-Reply-To: <20080701092548.12041.69868.stgit@raven.themaw.net>
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 <raven@themaw.net>
---
fs/autofs4/root.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 10add99..2a1a631 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -591,7 +591,6 @@ static struct dentry *autofs4_lookup_expiring(struct autofs_sb_info *sbi, struct
goto next;
if (d_unhashed(dentry)) {
- list_del_init(&ino->expiring);
dget(dentry);
spin_unlock(&dentry->d_lock);
spin_unlock(&sbi->lookup_lock);
@@ -643,6 +642,10 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
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);
}
next prev parent reply other threads:[~2008-07-01 9:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 9:25 [PATCH 1/5] autofs4 - fix symlink name allocation Ian Kent
2008-07-01 9:25 ` Ian Kent [this message]
2008-07-01 9:26 ` [PATCH 3/5] autofs4 - fix waitq locking Ian Kent
2008-07-01 9:26 ` [PATCH 4/5] autofs4 - check kernel communication pipe is valid for write Ian Kent
2008-07-01 9:26 ` [PATCH 5/5] autofs4 - fix waitq memory leak Ian Kent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080701092557.12041.32586.stgit@raven.themaw.net \
--to=raven@themaw.net \
--cc=akpm@linux-foundation.org \
--cc=autofs@linux.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®