patch-2.1.81 linux/fs/nfsd/nfsfh.c

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

diff -u --recursive --new-file v2.1.80/linux/fs/nfsd/nfsfh.c linux/fs/nfsd/nfsfh.c
@@ -999,21 +999,19 @@
 u32
 fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
 {
+	struct knfs_fh	*fh = &fhp->fh_handle;
 	struct svc_export *exp;
 	struct dentry	*dentry;
 	struct inode	*inode;
-	struct knfs_fh	*fh = &fhp->fh_handle;
 	u32		error = 0;
 
-	if(fhp->fh_dverified)
-		goto out;
-
-	dprintk("nfsd: fh_lookup(exp %x/%ld fh %p)\n",
-			fh->fh_xdev, fh->fh_xino, fh->fh_dcookie);
+	dprintk("nfsd: fh_verify(exp %x/%ld cookie %p)\n",
+		fh->fh_xdev, fh->fh_xino, fh->fh_dcookie);
 
+	if(fhp->fh_dverified)
+		goto check_type;
 	/*
 	 * Look up the export entry.
-	 * N.B. We need to lock this while in use ...
 	 */
 	error = nfserr_stale;
 	exp = exp_get(rqstp->rq_client, fh->fh_xdev, fh->fh_xino);
@@ -1057,6 +1055,8 @@
 	 * spec says this is incorrect (implementation notes for the
 	 * write call).
 	 */
+check_type:
+	dentry = fhp->fh_dentry;
 	inode = dentry->d_inode;
 	if (type > 0 && (inode->i_mode & S_IFMT) != type) {
 		error = (type == S_IFDIR)? nfserr_notdir : nfserr_isdir;
@@ -1069,9 +1069,11 @@
 
 	/* Finally, check access permissions. */
 	error = nfsd_permission(fhp->fh_export, dentry, access);
+#ifdef NFSD_PARANOIA
 if (error)
 printk("fh_verify: %s/%s permission failure, acc=%x, error=%d\n",
 dentry->d_parent->d_name.name, dentry->d_name.name, access, error);
+#endif
 
 out:
 	return error;

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