diff options
author | Ian Kent <raven@themaw.net> | 2005-06-21 20:16:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:35 -0400 |
commit | 9b1e3afd6d56937ced3914971621d0f053ea9178 (patch) | |
tree | 059762a20c069273247b423b6075adcd89624e42 /fs/autofs4/autofs_i.h | |
parent | 8818760512424f60ad9fafb7a087b007a9274eb3 (diff) |
[PATCH] autofs4: avoid panic on bind mount of autofs owned directory
While this is not a solution to bind and move mounts on autofs owned
directories it is necessary to fix the trady error handling.
At least it avoids the kernel panic I observed checking out bug #4589.
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/autofs_i.h')
-rw-r--r-- | fs/autofs4/autofs_i.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index c7b2b8890188..9c09641ce907 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -185,6 +185,19 @@ int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); | |||
185 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); | 185 | int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); |
186 | void autofs4_catatonic_mode(struct autofs_sb_info *); | 186 | void autofs4_catatonic_mode(struct autofs_sb_info *); |
187 | 187 | ||
188 | static inline int autofs4_follow_mount(struct vfsmount **mnt, struct dentry **dentry) | ||
189 | { | ||
190 | int res = 0; | ||
191 | |||
192 | while (d_mountpoint(*dentry)) { | ||
193 | int followed = follow_down(mnt, dentry); | ||
194 | if (!followed) | ||
195 | break; | ||
196 | res = 1; | ||
197 | } | ||
198 | return res; | ||
199 | } | ||
200 | |||
188 | static inline int simple_positive(struct dentry *dentry) | 201 | static inline int simple_positive(struct dentry *dentry) |
189 | { | 202 | { |
190 | return dentry->d_inode && !d_unhashed(dentry); | 203 | return dentry->d_inode && !d_unhashed(dentry); |