diff options
| author | Patrick McHardy <kaber@trash.net> | 2010-04-20 10:02:01 -0400 |
|---|---|---|
| committer | Patrick McHardy <kaber@trash.net> | 2010-04-20 10:02:01 -0400 |
| commit | 62910554656cdcd6b6f84a5154c4155aae4ca231 (patch) | |
| tree | dcf14004f6fd2ef7154362ff948bfeba0f3ea92d /fs/9p/fid.c | |
| parent | 22265a5c3c103cf8c50be62e6c90d045eb649e6d (diff) | |
| parent | ab9304717f7624c41927f442e6b6d418b2d8b3e4 (diff) | |
Merge branch 'master' of /repos/git/net-next-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
net/ipv6/netfilter/ip6t_REJECT.c
net/netfilter/xt_limit.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'fs/9p/fid.c')
| -rw-r--r-- | fs/9p/fid.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 08b2eb157048..7317b39b2815 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/errno.h> | 25 | #include <linux/errno.h> |
| 26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
| 28 | #include <linux/idr.h> | 29 | #include <linux/idr.h> |
| 29 | #include <net/9p/9p.h> | 30 | #include <net/9p/9p.h> |
| @@ -110,7 +111,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) | |||
| 110 | { | 111 | { |
| 111 | int i, n, l, clone, any, access; | 112 | int i, n, l, clone, any, access; |
| 112 | u32 uid; | 113 | u32 uid; |
| 113 | struct p9_fid *fid; | 114 | struct p9_fid *fid, *old_fid = NULL; |
| 114 | struct dentry *d, *ds; | 115 | struct dentry *d, *ds; |
| 115 | struct v9fs_session_info *v9ses; | 116 | struct v9fs_session_info *v9ses; |
| 116 | char **wnames, *uname; | 117 | char **wnames, *uname; |
| @@ -183,10 +184,18 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry) | |||
| 183 | l = min(n - i, P9_MAXWELEM); | 184 | l = min(n - i, P9_MAXWELEM); |
| 184 | fid = p9_client_walk(fid, l, &wnames[i], clone); | 185 | fid = p9_client_walk(fid, l, &wnames[i], clone); |
| 185 | if (IS_ERR(fid)) { | 186 | if (IS_ERR(fid)) { |
| 187 | if (old_fid) { | ||
| 188 | /* | ||
| 189 | * If we fail, clunk fid which are mapping | ||
| 190 | * to path component and not the last component | ||
| 191 | * of the path. | ||
| 192 | */ | ||
| 193 | p9_client_clunk(old_fid); | ||
| 194 | } | ||
| 186 | kfree(wnames); | 195 | kfree(wnames); |
| 187 | return fid; | 196 | return fid; |
| 188 | } | 197 | } |
| 189 | 198 | old_fid = fid; | |
| 190 | i += l; | 199 | i += l; |
| 191 | clone = 0; | 200 | clone = 0; |
| 192 | } | 201 | } |
