]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/attr.c
mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long-fix-2
[karo-tx-linux.git] / fs / attr.c
index 29e38a1f7f77a15100f1d20b3e51507470273633..9689817dd26a490b5b9424c2058bb2f879cc6a13 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -14,6 +14,7 @@
 #include <linux/fcntl.h>
 #include <linux/security.h>
 #include <linux/evm.h>
+#include <linux/ima.h>
 
 /**
  * inode_change_ok - check if attribute changes to an inode are allowed
@@ -183,6 +184,11 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
                        inode_inc_iversion(inode);
        }
 
+       if ((ia_valid & ATTR_SIZE) && IS_I_VERSION(inode)) {
+               if (attr->ia_size != inode->i_size)
+                       inode_inc_iversion(inode);
+       }
+
        if ((ia_valid & ATTR_MODE)) {
                umode_t amode = attr->ia_mode;
                /* Flag setting protected by i_mutex */
@@ -247,6 +253,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
 
        if (!error) {
                fsnotify_change(dentry, ia_valid);
+               ima_inode_post_setattr(dentry);
                evm_inode_post_setattr(dentry, ia_valid);
        }