Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192303
b: refs/heads/master
c: 23a3061
h: refs/heads/master
i:
  192301: f65b0da
  192299: bd87b9e
  192295: f53e3c0
  192287: cd27806
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 14, 2010
1 parent 3d2ed61 commit f414701
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb872f0c8e5c9801da05d5c2a6e402af8e27160e
refs/heads/master: 23a306120fcb2879ed2b814716c1cb2a8eb74f72
26 changes: 16 additions & 10 deletions trunk/fs/nfs/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ static int
nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
unsigned int len, struct iattr *sattr)
{
struct nfs_fh fhandle;
struct nfs_fattr fattr;
struct nfs_fh *fh;
struct nfs_fattr *fattr;
struct nfs_symlinkargs arg = {
.fromfh = NFS_FH(dir),
.fromname = dentry->d_name.name,
Expand All @@ -432,12 +432,18 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
.rpc_proc = &nfs_procedures[NFSPROC_SYMLINK],
.rpc_argp = &arg,
};
int status;
int status = -ENAMETOOLONG;

dprintk("NFS call symlink %s\n", dentry->d_name.name);

if (len > NFS2_MAXPATHLEN)
return -ENAMETOOLONG;
goto out;

dprintk("NFS call symlink %s\n", dentry->d_name.name);
fh = nfs_alloc_fhandle();
fattr = nfs_alloc_fattr();
status = -ENOMEM;
if (fh == NULL || fattr == NULL)
goto out;

status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
nfs_mark_for_revalidate(dir);
Expand All @@ -447,12 +453,12 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
* filehandle size to zero indicates to nfs_instantiate that it
* should fill in the data with a LOOKUP call on the wire.
*/
if (status == 0) {
nfs_fattr_init(&fattr);
fhandle.size = 0;
status = nfs_instantiate(dentry, &fhandle, &fattr);
}
if (status == 0)
status = nfs_instantiate(dentry, fh, fattr);

nfs_free_fattr(fattr);
nfs_free_fhandle(fh);
out:
dprintk("NFS reply symlink: %d\n", status);
return status;
}
Expand Down

0 comments on commit f414701

Please sign in to comment.