|
@@ -295,6 +295,17 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
|
|
|
|
|
|
|
sb_start_write(inode->i_sb);
|
|
sb_start_write(inode->i_sb);
|
|
|
ret = file->f_op->fallocate(file, mode, offset, len);
|
|
ret = file->f_op->fallocate(file, mode, offset, len);
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ * Create inotify and fanotify events.
|
|
|
|
|
+ *
|
|
|
|
|
+ * To keep the logic simple always create events if fallocate succeeds.
|
|
|
|
|
+ * This implies that events are even created if the file size remains
|
|
|
|
|
+ * unchanged, e.g. when using flag FALLOC_FL_KEEP_SIZE.
|
|
|
|
|
+ */
|
|
|
|
|
+ if (ret == 0)
|
|
|
|
|
+ fsnotify_modify(file);
|
|
|
|
|
+
|
|
|
sb_end_write(inode->i_sb);
|
|
sb_end_write(inode->i_sb);
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|