diff options
author | Eryu Guan <guaneryu@gmail.com> | 2016-08-02 07:58:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-07 10:03:31 -0400 |
commit | 337684a1746f93ae107e05d90977b070bb7e39d8 (patch) | |
tree | 1922204c16c1b9a8a54cecb8d3512f2b46a2695b /fs/gfs2/inode.c | |
parent | fe64f3283fb315e3d8f2b78785a86904a852ca82 (diff) |
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/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e0621cacf134..e4da0ecd3285 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -1800,7 +1800,7 @@ int gfs2_permission(struct inode *inode, int mask) | |||
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode)) | 1802 | if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode)) |
1803 | error = -EACCES; | 1803 | error = -EPERM; |
1804 | else | 1804 | else |
1805 | error = generic_permission(inode, mask); | 1805 | error = generic_permission(inode, mask); |
1806 | if (gfs2_holder_initialized(&i_gh)) | 1806 | if (gfs2_holder_initialized(&i_gh)) |