The patch titled Subject: vfs: increment iversion when a file is truncated has been added to the -mm tree. Its filename is vfs-increment-iversion-when-a-file-is-truncated.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Dmitry Kasatkin <dmitry.kasatkin@xxxxxxxxx> Subject: vfs: increment iversion when a file is truncated When a file is truncated with truncate()/ftruncate() and then closed, iversion is not updated. This patch uses ATTR_SIZE flag as an indication to increment iversion. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@xxxxxxxxx> Acked-by: Mimi Zohar <zohar@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/attr.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN fs/attr.c~vfs-increment-iversion-when-a-file-is-truncated fs/attr.c --- a/fs/attr.c~vfs-increment-iversion-when-a-file-is-truncated +++ a/fs/attr.c @@ -176,6 +176,11 @@ int notify_change(struct dentry * dentry return -EPERM; } + 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 */ _ Subject: Subject: vfs: increment iversion when a file is truncated Patches currently in -mm which might be from dmitry.kasatkin@xxxxxxxxx are linux-next.patch vfs-increment-iversion-when-a-file-is-truncated.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html