2005-07-11 11:06:40

by Olaf Kirch

[permalink] [raw]
Subject: [PATCH nfsd] ignore chmod calls on symlinks

I submitted this before - this is a somewhat cosmetic fix to
keep the SpecFS validation test from complaining.

Signed-off-by: Olaf Kirch <[email protected]>

Index: linux-2.6.12/fs/nfsd/vfs.c
===================================================================
--- linux-2.6.12.orig/fs/nfsd/vfs.c 2005-07-08 11:45:19.000000000 +0200
+++ linux-2.6.12/fs/nfsd/vfs.c 2005-07-11 13:05:33.000000000 +0200
@@ -255,12 +255,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.
--
Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
[email protected] | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2005-07-11 12:47:54

by Peter Staubach

[permalink] [raw]
Subject: Re: [PATCH nfsd] ignore chmod calls on symlinks

Olaf Kirch wrote:

>I submitted this before - this is a somewhat cosmetic fix to
>keep the SpecFS validation test from complaining.
>

It seems to me that this test could/should considered to be broken and
hence,
fixed, as opposed to cluttering up file system dependent code with checks
like this that the upper layers are responsible for catching.

ps


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-07-11 12:59:23

by Olaf Kirch

[permalink] [raw]
Subject: Re: [PATCH nfsd] ignore chmod calls on symlinks

On Mon, Jul 11, 2005 at 08:46:55AM -0400, Peter Staubach wrote:
> >I submitted this before - this is a somewhat cosmetic fix to
> >keep the SpecFS validation test from complaining.
> >
>
> It seems to me that this test could/should considered to be broken and
> hence,
> fixed, as opposed to cluttering up file system dependent code with checks
> like this that the upper layers are responsible for catching.

An NFS client is allowed to send a chmod on a symlink. It just happens
to be an illegal operation on most file systems.

Olaf
--
Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
[email protected] | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-07-11 13:07:16

by Peter Staubach

[permalink] [raw]
Subject: Re: [PATCH nfsd] ignore chmod calls on symlinks

Olaf Kirch wrote:

>On Mon, Jul 11, 2005 at 08:46:55AM -0400, Peter Staubach wrote:
>
>
>>>I submitted this before - this is a somewhat cosmetic fix to
>>>keep the SpecFS validation test from complaining.
>>>
>>>
>>>
>>It seems to me that this test could/should considered to be broken and
>>hence,
>>fixed, as opposed to cluttering up file system dependent code with checks
>>like this that the upper layers are responsible for catching.
>>
>>
>
>An NFS client is allowed to send a chmod on a symlink. It just happens
>to be an illegal operation on most file systems.
>

So, the nfsd layer is not doing what the vfs layer on the system is already
for callers into the file systems?

Thanx...

ps


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2005-07-12 08:53:02

by Olaf Kirch

[permalink] [raw]
Subject: Re: [PATCH nfsd] ignore chmod calls on symlinks

On Mon, Jul 11, 2005 at 09:05:58AM -0400, Peter Staubach wrote:
> So, the nfsd layer is not doing what the vfs layer on the system is already
> for callers into the file systems?

Yes. sys_chmod will dereference any symlinks, so the situation is
entirely different.

If nfsd tries to chmod a symlink on eg reiserfs, it will get an
EOPNOTSUPP or something like this.

Olaf
--
Olaf Kirch | --- o --- Nous sommes du soleil we love when we play
[email protected] | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs