All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kNFSd - 2 of 7 - Revlaidate inodes after filehandle and name lookup in nfsd
@ 2002-12-17  1:59 NeilBrown
  2002-12-17 14:36 ` Irina Slutsky
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2002-12-17  1:59 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: nfs



The patch was written by Marc Eshel and Frank Schmuck. 
It was received from  "Brian Dixon" <dixonbp@us.ibm.com>
though I changed it slightly.

 ----------- Diffstat output ------------
 ./fs/nfsd/nfsfh.c |    7 +++++++
 ./fs/nfsd/vfs.c   |   12 +++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff ./fs/nfsd/nfsfh.c~current~ ./fs/nfsd/nfsfh.c
--- ./fs/nfsd/nfsfh.c~current~	2002-12-16 16:28:47.000000000 +1100
+++ ./fs/nfsd/nfsfh.c	2002-12-16 16:28:47.000000000 +1100
@@ -620,6 +620,13 @@ fh_verify(struct svc_rqst *rqstp, struct
 			switch (fh->fh_fileid_type) {
 			case 0:
 				dentry = dget(exp->ex_dentry);
+				/* need to revalidate the inode */
+				inode = dentry->d_inode;
+				if (inode->i_op && inode->i_op->revalidate)
+					if (inode->i_op->revalidate(dentry)) {
+						dput(dentry);
+						dentry = ERR_PTR(-ESTALE);
+					}
 				break;
 			default:
 				dentry = find_fh_dentry(exp->ex_dentry->d_inode->i_sb,

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c
--- ./fs/nfsd/vfs.c~current~	2002-12-16 16:28:47.000000000 +1100
+++ ./fs/nfsd/vfs.c	2002-12-16 16:28:47.000000000 +1100
@@ -168,11 +168,13 @@ nfsd_lookup(struct svc_rqst *rqstp, stru
 			mntput(mnt);
 		}
 	}
-	/*
-	 * Note: we compose the file handle now, but as the
-	 * dentry may be negative, it may need to be updated.
-	 */
-	err = fh_compose(resfh, exp, dentry, fhp);
+
+	if (dentry->d_inode && dentry->d_inode->i_op &&
+	    dentry->d_inode->i_op->revalidate &&
+	    dentry->d_inode->i_op->revalidate(dentry))
+		err = nfserr_noent;
+	else
+		err = fh_compose(resfh, exp, dentry, fhp);
 	if (!err && !dentry->d_inode)
 		err = nfserr_noent;
 out:


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-17 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-17  1:59 [PATCH] kNFSd - 2 of 7 - Revlaidate inodes after filehandle and name lookup in nfsd NeilBrown
2002-12-17 14:36 ` Irina Slutsky
2002-12-17 22:50   ` Neil Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.