2005-10-14 02:23:17

by NeilBrown

[permalink] [raw]
Subject: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return



This is a somewhat cosmetic fix to keep the SpecFS validation test
from complaining.
SpecFS want's to try chmod on symlinks, and ext3 and reiser (at least)
return ENOTSUPP.
Probably both sides are being silly, but it is easiest to simply make
it a non-issue and filter out chmod requests on symlinks at the nfsd level.

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./fs/nfsd/vfs.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c
--- ./fs/nfsd/vfs.c~current~ 2005-10-14 12:01:38.000000000 +1000
+++ ./fs/nfsd/vfs.c 2005-10-14 12:02:07.000000000 +1000
@@ -254,12 +254,19 @@ nfsd_setattr(struct svc_rqst *rqstp, str

/* Get inode */
err = fh_verify(rqstp, fhp, ftype, accmode);
- if (err || !iap->ia_valid)
+ if (err)
goto out;

dentry = fhp->fh_dentry;
inode = dentry->d_inode;

+ /* Ignore any mode updates on symlinks */
+ if (S_ISLNK(inode->i_mode))
+ iap->ia_valid &= ~ATTR_MODE;
+
+ if (!iap->ia_valid)
+ goto out;
+
/* NFSv2 does not differentiate between "set-[ac]time-to-now"
* which only requires access, and "set-[ac]time-to-X" which
* requires ownership.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2005-10-14 19:46:16

by Peter Staubach

[permalink] [raw]
Subject: Re: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return

James Yarbrough wrote:

>I thought we were talking about Spec SFS.
>I could be confused, though.
>

I assumed that "SpecFS" was something different than "SPEC SFS". I know
that I am confused. :-)

ps


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-10-14 12:30:03

by Peter Staubach

[permalink] [raw]
Subject: Re: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return

NeilBrown wrote:

>This is a somewhat cosmetic fix to keep the SpecFS validation test
>from complaining.
>SpecFS want's to try chmod on symlinks, and ext3 and reiser (at least)
>return ENOTSUPP.
>Probably both sides are being silly, but it is easiest to simply make
>it a non-issue and filter out chmod requests on symlinks at the nfsd level.
>

Wouldn't it be better to fix the testsuite to not do this? Doesn't the
testsuite also fail when run against ext3 and/or reiser file systems?

This is just overhead which will slow the NFS server a tiny bit.

Just out of curiosity, how does the testsuite even generate a chmod(2)
request on a symbolic link? The chmod(2) system call semantics should
not allow this.

Thanx...

ps


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-10-14 18:41:51

by James Yarbrough

[permalink] [raw]
Subject: Re: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return

As I recall, the SpecFS tests exercise the NFS protocols directly, rather
than through the filesystem interface provided by the client OS.

Peter Staubach wrote:
>
> Just out of curiosity, how does the testsuite even generate a chmod(2)
> request on a symbolic link? The chmod(2) system call semantics should
> not allow this.

--
[email protected]
650 933 3124

Let's get ta jigglin'!


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-10-14 19:35:52

by Peter Staubach

[permalink] [raw]
Subject: Re: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return

James Yarbrough wrote:

>As I recall, the SpecFS tests exercise the NFS protocols directly, rather
>than through the filesystem interface provided by the client OS.
>
>Peter Staubach wrote:
>
>
>>Just out of curiosity, how does the testsuite even generate a chmod(2)
>>request on a symbolic link? The chmod(2) system call semantics should
>>not allow this.
>>
>>

Are we talking about the SPEC SFS benchmark or something else?

Thanx...

ps


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-10-14 19:43:03

by James Yarbrough

[permalink] [raw]
Subject: Re: [PATCH kNFSd 001 of 4] fix setattr-on-symlink error return

I thought we were talking about Spec SFS.
I could be confused, though.

--
[email protected]
650 933 3124

Let's get ta jigglin'!


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs