summaryrefslogtreecommitdiffstats
path: root/fs/autofs4/waitq.c
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2006-03-27 01:14:59 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 08:44:41 -0800
commit3e7b19198003fc25b11838e709f17d4fa173b2d7 (patch)
tree6d78904c52b5c96c1c6f59544658235ef2a3c1ab /fs/autofs4/waitq.c
parent871f94344cea36b2ce91231f442f9f9298529712 (diff)
downloadop-kernel-dev-3e7b19198003fc25b11838e709f17d4fa173b2d7.zip
op-kernel-dev-3e7b19198003fc25b11838e709f17d4fa173b2d7.tar.gz
[PATCH] autofs4: atomic var underflow
Fix accidental underflow of the atomic counter. Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/autofs4/waitq.c')
-rw-r--r--fs/autofs4/waitq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 894d746..142ab6a 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -263,7 +263,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
wq->tgid = current->tgid;
wq->status = -EINTR; /* Status return if interrupted */
atomic_set(&wq->wait_ctr, 2);
- atomic_set(&wq->notified, 1);
+ atomic_set(&wq->notify, 1);
mutex_unlock(&sbi->wq_mutex);
} else {
atomic_inc(&wq->wait_ctr);
@@ -273,9 +273,11 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
}
- if (notify != NFY_NONE && atomic_dec_and_test(&wq->notified)) {
+ if (notify != NFY_NONE && atomic_read(&wq->notify)) {
int type;
+ atomic_dec(&wq->notify);
+
if (sbi->version < 5) {
if (notify == NFY_MOUNT)
type = autofs_ptype_missing;
OpenPOWER on IntegriCloud