projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fs/9p: Clunk the fid resulting from partial walk of the name
[deliverable/linux.git]
/
fs
/
9p
/
fid.c
diff --git
a/fs/9p/fid.c
b/fs/9p/fid.c
index 08b2eb157048b26aafd052daaeba4c8e38239f0a..b0a23c7e736e6aeff9f95be9a11d9686baf2cf89 100644
(file)
--- a/
fs/9p/fid.c
+++ b/
fs/9p/fid.c
@@
-110,7
+110,7
@@
struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
{
int i, n, l, clone, any, access;
u32 uid;
{
int i, n, l, clone, any, access;
u32 uid;
- struct p9_fid *fid;
+ struct p9_fid *fid
, *old_fid = NULL
;
struct dentry *d, *ds;
struct v9fs_session_info *v9ses;
char **wnames, *uname;
struct dentry *d, *ds;
struct v9fs_session_info *v9ses;
char **wnames, *uname;
@@
-183,10
+183,18
@@
struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
l = min(n - i, P9_MAXWELEM);
fid = p9_client_walk(fid, l, &wnames[i], clone);
if (IS_ERR(fid)) {
l = min(n - i, P9_MAXWELEM);
fid = p9_client_walk(fid, l, &wnames[i], clone);
if (IS_ERR(fid)) {
+ if (old_fid) {
+ /*
+ * If we fail, clunk fid which are mapping
+ * to path component and not the last component
+ * of the path.
+ */
+ p9_client_clunk(old_fid);
+ }
kfree(wnames);
return fid;
}
kfree(wnames);
return fid;
}
-
+ old_fid = fid;
i += l;
clone = 0;
}
i += l;
clone = 0;
}
This page took
0.025113 seconds
and
5
git commands to generate.