patch-2.1.65 linux/fs/nfsd/nfsproc.c

Next file: linux/fs/nfsd/nfsxdr.c
Previous file: linux/fs/nfsd/nfsfh.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.64/linux/fs/nfsd/nfsproc.c linux/fs/nfsd/nfsproc.c
@@ -78,6 +78,8 @@
 
 /*
  * Look up a path name component
+ * Note: the dentry in the resp->fh may be negative if the file
+ * doesn't exist yet.
  * N.B. After this call resp->fh needs an fh_put
  */
 static int
@@ -88,10 +90,8 @@
 
 	dprintk("nfsd: LOOKUP   %p %s\n", SVCFH_DENTRY(&argp->fh), argp->name);
 
-	nfserr = nfsd_lookup(rqstp, &argp->fh,
-				    argp->name,
-				    argp->len,
-				    &resp->fh);
+	nfserr = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
+				 &resp->fh);
 
 	fh_put(&argp->fh);
 	RETURN(nfserr);
@@ -209,11 +209,10 @@
 	nfserr = fh_verify(rqstp, dirfhp, S_IFDIR, MAY_EXEC);
 	if (nfserr)
 		goto done; /* must fh_put dirfhp even on error */
-	dirp = dirfhp->fh_handle.fh_dentry->d_inode;
+	dirp = dirfhp->fh_dentry->d_inode;
 
 	/* Check for MAY_WRITE separately. */
-	nfserr = nfsd_permission(dirfhp->fh_export,
-				 dirfhp->fh_handle.fh_dentry,
+	nfserr = nfsd_permission(dirfhp->fh_export, dirfhp->fh_dentry,
 				 MAY_WRITE);
 	if (nfserr == nfserr_rofs) {
 		rdonly = 1;	/* Non-fatal error for echo > /dev/null */
@@ -224,7 +223,7 @@
 	exists = !nfsd_lookup(rqstp, dirfhp, argp->name, argp->len, newfhp);
 
 	if (newfhp->fh_dverified)
-		inode = newfhp->fh_handle.fh_dentry->d_inode;
+		inode = newfhp->fh_dentry->d_inode;
 
 	/* Get rid of this soon... */
 	if (exists && !inode) {

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