Merge tag 'libnvdimm-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[linux-2.6-microblaze.git] / fs / ext4 / file.c
index 4feeeca..70b0438 100644 (file)
@@ -165,6 +165,10 @@ static ssize_t ext4_write_checks(struct kiocb *iocb, struct iov_iter *from)
        ret = generic_write_checks(iocb, from);
        if (ret <= 0)
                return ret;
+
+       if (unlikely(IS_IMMUTABLE(inode)))
+               return -EPERM;
+
        /*
         * If we have encountered a bitmap-format file, the size limit
         * is smaller than s_maxbytes, which is for extent-mapped files.