summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorEryu Guan <guaneryu@gmail.com>2016-08-02 13:58:28 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-07 16:03:31 +0200
commit337684a1746f93ae107e05d90977b070bb7e39d8 (patch)
tree1922204c16c1b9a8a54cecb8d3512f2b46a2695b /fs/namei.c
parentMerge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/v... (diff)
downloadlinux-337684a1746f93ae107e05d90977b070bb7e39d8.tar.xz
linux-337684a1746f93ae107e05d90977b070bb7e39d8.zip
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 <dchinner@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c386a329ab20..adb04146df09 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -410,7 +410,7 @@ int __inode_permission(struct inode *inode, int mask)
* Nobody gets write access to an immutable file.
*/
if (IS_IMMUTABLE(inode))
- return -EACCES;
+ return -EPERM;
/*
* Updating mtime will likely cause i_uid and i_gid to be