From: NeilBrown 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 Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown Signed-off-by: Andrew Morton --- fs/nfsd/vfs.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) diff -puN fs/nfsd/vfs.c~knfsd-fix-setattr-on-symlink-error-return fs/nfsd/vfs.c --- 25/fs/nfsd/vfs.c~knfsd-fix-setattr-on-symlink-error-return Fri Oct 14 12:27:28 2005 +++ 25-akpm/fs/nfsd/vfs.c Fri Oct 14 12:27:28 2005 @@ -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. _