Loading fs/nfs/proc.c +16 −10 Original line number Original line Diff line number Diff line Loading @@ -418,8 +418,8 @@ static int nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, unsigned int len, struct iattr *sattr) unsigned int len, struct iattr *sattr) { { struct nfs_fh fhandle; struct nfs_fh *fh; struct nfs_fattr fattr; struct nfs_fattr *fattr; struct nfs_symlinkargs arg = { struct nfs_symlinkargs arg = { .fromfh = NFS_FH(dir), .fromfh = NFS_FH(dir), .fromname = dentry->d_name.name, .fromname = dentry->d_name.name, Loading @@ -432,12 +432,18 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, .rpc_proc = &nfs_procedures[NFSPROC_SYMLINK], .rpc_proc = &nfs_procedures[NFSPROC_SYMLINK], .rpc_argp = &arg, .rpc_argp = &arg, }; }; int status; int status = -ENAMETOOLONG; dprintk("NFS call symlink %s\n", dentry->d_name.name); if (len > NFS2_MAXPATHLEN) 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); status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_mark_for_revalidate(dir); nfs_mark_for_revalidate(dir); Loading @@ -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 * filehandle size to zero indicates to nfs_instantiate that it * should fill in the data with a LOOKUP call on the wire. * should fill in the data with a LOOKUP call on the wire. */ */ if (status == 0) { if (status == 0) nfs_fattr_init(&fattr); status = nfs_instantiate(dentry, fh, fattr); fhandle.size = 0; status = nfs_instantiate(dentry, &fhandle, &fattr); } nfs_free_fattr(fattr); nfs_free_fhandle(fh); out: dprintk("NFS reply symlink: %d\n", status); dprintk("NFS reply symlink: %d\n", status); return status; return status; } } Loading Loading
fs/nfs/proc.c +16 −10 Original line number Original line Diff line number Diff line Loading @@ -418,8 +418,8 @@ static int nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, unsigned int len, struct iattr *sattr) unsigned int len, struct iattr *sattr) { { struct nfs_fh fhandle; struct nfs_fh *fh; struct nfs_fattr fattr; struct nfs_fattr *fattr; struct nfs_symlinkargs arg = { struct nfs_symlinkargs arg = { .fromfh = NFS_FH(dir), .fromfh = NFS_FH(dir), .fromname = dentry->d_name.name, .fromname = dentry->d_name.name, Loading @@ -432,12 +432,18 @@ nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, .rpc_proc = &nfs_procedures[NFSPROC_SYMLINK], .rpc_proc = &nfs_procedures[NFSPROC_SYMLINK], .rpc_argp = &arg, .rpc_argp = &arg, }; }; int status; int status = -ENAMETOOLONG; dprintk("NFS call symlink %s\n", dentry->d_name.name); if (len > NFS2_MAXPATHLEN) 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); status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_mark_for_revalidate(dir); nfs_mark_for_revalidate(dir); Loading @@ -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 * filehandle size to zero indicates to nfs_instantiate that it * should fill in the data with a LOOKUP call on the wire. * should fill in the data with a LOOKUP call on the wire. */ */ if (status == 0) { if (status == 0) nfs_fattr_init(&fattr); status = nfs_instantiate(dentry, fh, fattr); fhandle.size = 0; status = nfs_instantiate(dentry, &fhandle, &fattr); } nfs_free_fattr(fattr); nfs_free_fhandle(fh); out: dprintk("NFS reply symlink: %d\n", status); dprintk("NFS reply symlink: %d\n", status); return status; return status; } } Loading