* [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* RE: [PATCH] kNFSd - 2 of 7 - Revlaidate inodes after filehandle and name lookup in nfsd
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
0 siblings, 1 reply; 3+ messages in thread
From: Irina Slutsky @ 2002-12-17 14:36 UTC (permalink / raw)
To: nfs; +Cc: 'Brian Dixon', 'NeilBrown'
Thanks for this patch. Problem, this patch is addressing is very
important for me. This is the behaviors I am missing and is trying to
work around. When do you think this patch can be incorporated in the
official kernel release?
Small note: there is an inline routine
do_reavlidate(struct denty *) in the kernel
that could be used instead. It has all the "if"s checking inside.
I also have a question on the same topic:
Is there any particular reason for not allowing a fs to create file
handle for exported entry? I know the code is easier this way, but it
would be very useful.
Thanks
Irina Slutsky
-----Original Message-----
From: nfs-admin@lists.sourceforge.net
[mailto:nfs-admin@lists.sourceforge.net] On Behalf Of NeilBrown
Sent: Monday, December 16, 2002 8:59 PM
To: Marcelo Tosatti
Cc: nfs@lists.sourceforge.net
Subject: [NFS] [PATCH] kNFSd - 2 of 7 - Revlaidate inodes after
filehandle and name lookup in nfsd
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
-------------------------------------------------------
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* RE: [PATCH] kNFSd - 2 of 7 - Revlaidate inodes after filehandle and name lookup in nfsd
2002-12-17 14:36 ` Irina Slutsky
@ 2002-12-17 22:50 ` Neil Brown
0 siblings, 0 replies; 3+ messages in thread
From: Neil Brown @ 2002-12-17 22:50 UTC (permalink / raw)
To: Irina Slutsky; +Cc: nfs, 'Brian Dixon'
On Tuesday December 17, ira@ibrix.com wrote:
> Thanks for this patch. Problem, this patch is addressing is very
> important for me. This is the behaviors I am missing and is trying to
> work around. When do you think this patch can be incorporated in the
> official kernel release?
Hopefully in 2.4.21, whenever that comes out.
>
> Small note: there is an inline routine
> do_reavlidate(struct denty *) in the kernel
> that could be used instead. It has all the "if"s checking inside.
So there is... but it is in lots of .c files and no .h's.
I guess I could copy it but I don't know that it is worth it.
>
> I also have a question on the same topic:
>
> Is there any particular reason for not allowing a fs to create file
> handle for exported entry? I know the code is easier this way, but it
> would be very useful.
It isn't so much that it is not "allowed", but rather that it is not
"required". knfsd can find the file without any help from the
filesystem, so it doesn't even both to ask.
How would it be useful to you if it did?
NeilBrown
-------------------------------------------------------
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.