patch-2.1.51 linux/fs/nfs/dir.c

Next file: linux/fs/nfs/symlink.c
Previous file: linux/fs/ncpfs/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.50/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
@@ -561,9 +561,6 @@
 static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
 {
 	struct nfs_sattr sattr;
-	struct nfs_fattr fattr;
-	struct nfs_fh fhandle;
-	struct inode * inode;
 	int error;
 
 	dfprintk(VFS, "NFS: symlink(%x/%ld, %s, %s)\n",
@@ -590,12 +587,16 @@
 	if (error)
 		return error;
 
-	inode = nfs_fhget(dir->i_sb, &fhandle, &fattr);
-	if (!inode)
-		return -EACCES;
-
 	nfs_invalidate_dircache(dir);
-	d_instantiate(dentry, inode);
+	/*  this looks _funny_ doesn't it? But: nfs_proc_symlynk()
+	 *  only fills in sattr, not fattr. Thus nfs_fhget() cannot be
+	 *  called, it would be pointless, without a valid fattr
+	 *  argument. Other possibility: call nfs_proc_lookup()
+	 *  HERE. But why? If somebody wants to reference this
+	 *  symlink, the cached_lookup() will fail, and
+	 *  nfs_proc_symlink() will be called anyway.
+	 */
+	d_drop(dentry);
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov