diff options
author | Ian Kent <raven@themaw.net> | 2007-02-20 16:58:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-20 20:10:15 -0500 |
commit | f50b6f8691cae2e0064c499dd3ef3f31142987f0 (patch) | |
tree | 56c449af977772a42939afde5230c4809a057ffe /fs/autofs4/autofs_i.h | |
parent | e8514478f63b95548a49576ba96b47edeb8596e0 (diff) |
[PATCH] autofs4: fix another race between mount and expire
Jeff Moyer has identified a race between mount and expire.
What happens is that during an expire the situation can arise that a directory
is removed and another lookup is done before the expire issues a completion
status to the kernel module. In this case, since the the lookup gets a new
dentry, it doesn't know that there is an expire in progress and when it posts
its mount request, matches the existing expire request and waits for its
completion. ENOENT is then returned to user space from lookup (as the dentry
passed in is now unhashed) without having performed the mount request.
The solution used here is to keep track of dentrys in this unhashed state and
reuse them, if possible, in order to preserve the flags. Additionally, this
infrastructure will provide the framework for the reintroduction of caching of
mount fails removed earlier in development.
Signed-off-by: Ian Kent <raven@themaw.net>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/autofs4/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 6b4cec3f272f..d85f42fa9206 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -52,6 +52,8 @@ struct autofs_info { | |||
52 | 52 | ||
53 | int flags; | 53 | int flags; |
54 | 54 | ||
55 | struct list_head rehash; | ||
56 | |||
55 | struct autofs_sb_info *sbi; | 57 | struct autofs_sb_info *sbi; |
56 | unsigned long last_used; | 58 | unsigned long last_used; |
57 | atomic_t count; | 59 | atomic_t count; |
@@ -110,6 +112,8 @@ struct autofs_sb_info { | |||
110 | struct mutex wq_mutex; | 112 | struct mutex wq_mutex; |
111 | spinlock_t fs_lock; | 113 | spinlock_t fs_lock; |
112 | struct autofs_wait_queue *queues; /* Wait queue pointer */ | 114 | struct autofs_wait_queue *queues; /* Wait queue pointer */ |
115 | spinlock_t rehash_lock; | ||
116 | struct list_head rehash_list; | ||
113 | }; | 117 | }; |
114 | 118 | ||
115 | static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb) | 119 | static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb) |