fs: return EPERM on immutable inode
[sfrench/cifs-2.6.git] / fs / utimes.c
index 85c40f4f373d56b3d5d41ed2fe7459759c8a3aeb..794f5f5b1fb5cfd636725bfd65a7d21df916c36e 100644 (file)
@@ -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)