Skip to contentSkip to conversation

ignore chmod calls on symlinks

PATCH In review Olaf Kirch 2 participants 5 messages Jul 11, 2005 – Jul 12, 2005

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 ignore chmod calls on symlinks

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

fs/nfsd/vfs.c +8 -1
Index: linux-2.6.12/fs/nfsd/vfs.c
===================================================================
@@ -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.
Signature · 12 lines
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
#1 lore raw
Quoted 3 lines · Olaf Kirch

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

author
#2 lore raw
Quoted 8 lines · Peter Staubach
Quoted 3 lines

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

Signature · 12 lines
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
#3 lore raw
Quoted 8 lines · Olaf Kirch
Quoted 5 lines · Peter Staubach
Quoted 5 lines

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

Quoted 9 lines
Quoted 5 lines

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

author
#4 lore raw
Quoted 2 lines · Peter Staubach

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

Signature · 12 lines
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