mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
fs: return EPERM on immutable inode
In most cases, EPERM is returned on immutable inode, and there're only a few places returning EACCES. I noticed this when running LTP on overlayfs, setxattr03 failed due to unexpected EACCES on immutable inode. So converting all EACCES to EPERM on immutable inode. Acked-by: Dave Chinner <[email protected]> Signed-off-by: Eryu Guan <[email protected]> Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fe64f3283f
commit
337684a174
4 changed files with 5 additions and 4 deletions
|
|
@ -92,10 +92,11 @@ static int utimes_common(struct path *path, struct timespec *times)
|
|||
* then we need to check permissions, because
|
||||
* inode_change_ok() won't do it.
|
||||
*/
|
||||
error = -EACCES;
|
||||
error = -EPERM;
|
||||
if (IS_IMMUTABLE(inode))
|
||||
goto mnt_drop_write_and_out;
|
||||
|
||||
error = -EACCES;
|
||||
if (!inode_owner_or_capable(inode)) {
|
||||
error = inode_permission(inode, MAY_WRITE);
|
||||
if (error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue