mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	[PATCH] knfsd: 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 <okir@suse.de> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
		
							parent
							
								
									8bc3efcfbf
								
							
						
					
					
						commit
						15b7a1b86d
					
				| @ -254,12 +254,19 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap, | |||||||
| 
 | 
 | ||||||
| 	/* Get inode */ | 	/* Get inode */ | ||||||
| 	err = fh_verify(rqstp, fhp, ftype, accmode); | 	err = fh_verify(rqstp, fhp, ftype, accmode); | ||||||
| 	if (err || !iap->ia_valid) | 	if (err) | ||||||
| 		goto out; | 		goto out; | ||||||
| 
 | 
 | ||||||
| 	dentry = fhp->fh_dentry; | 	dentry = fhp->fh_dentry; | ||||||
| 	inode = dentry->d_inode; | 	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"
 | 	/* NFSv2 does not differentiate between "set-[ac]time-to-now"
 | ||||||
| 	 * which only requires access, and "set-[ac]time-to-X" which | 	 * which only requires access, and "set-[ac]time-to-X" which | ||||||
| 	 * requires ownership. | 	 * requires ownership. | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 NeilBrown
						NeilBrown