diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-09 16:22:18 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-14 09:15:27 -0400 |
commit | 40b39136f07279fdc868a36cba050f4e84ce0ace (patch) | |
tree | cd68e514f1b410d034c3b49678d15c352a38d6da /fs/namei.c | |
parent | f374ed5fa8afed8590deaae5dc147422e0e1a6d9 (diff) |
path_openat: clean ELOOP handling a bit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/namei.c b/fs/namei.c index 6972e761286b..ca9a06a65704 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2320,11 +2320,12 @@ static struct file *path_openat(int dfd, const char *pathname, | |||
2320 | struct path link = path; | 2320 | struct path link = path; |
2321 | struct inode *linki = link.dentry->d_inode; | 2321 | struct inode *linki = link.dentry->d_inode; |
2322 | void *cookie; | 2322 | void *cookie; |
2323 | error = -ELOOP; | 2323 | if (!(nd.flags & LOOKUP_FOLLOW) || count++ == 32) { |
2324 | if (!(nd.flags & LOOKUP_FOLLOW)) | 2324 | path_put_conditional(&path, &nd); |
2325 | goto exit_dput; | 2325 | path_put(&nd.path); |
2326 | if (count++ == 32) | 2326 | filp = ERR_PTR(-ELOOP); |
2327 | goto exit_dput; | 2327 | break; |
2328 | } | ||
2328 | /* | 2329 | /* |
2329 | * This is subtle. Instead of calling do_follow_link() we do | 2330 | * This is subtle. Instead of calling do_follow_link() we do |
2330 | * the thing by hands. The reason is that this way we have zero | 2331 | * the thing by hands. The reason is that this way we have zero |
@@ -2355,9 +2356,6 @@ out: | |||
2355 | release_open_intent(&nd); | 2356 | release_open_intent(&nd); |
2356 | return filp; | 2357 | return filp; |
2357 | 2358 | ||
2358 | exit_dput: | ||
2359 | path_put_conditional(&path, &nd); | ||
2360 | path_put(&nd.path); | ||
2361 | out_filp: | 2359 | out_filp: |
2362 | filp = ERR_PTR(error); | 2360 | filp = ERR_PTR(error); |
2363 | goto out; | 2361 | goto out; |