[PATCH] Btrfs: set hole punching time properly

DORMANTno replies

From: Tsutomu Itoh <hidden>
Date: 2012-11-08 04:47:59
Subsystem: btrfs file system, filesystems (vfs and infrastructure), the rest · Maintainers: David Sterba, Alexander Viro, Christian Brauner, Linus Torvalds

Even if the hole punching is executed, the modification time of the
file is not updated.
So, current time is set to inode.

Signed-off-by: Tsutomu Itoh <redacted>
---
 fs/btrfs/file.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 110d3cb..15fecc1 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1964,6 +1964,9 @@ out_trans:
 	if (!trans)
 		goto out_free;
 
+	inode_inc_iversion(inode);
+	inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+
 	trans->block_rsv = &root->fs_info->trans_block_rsv;
 	ret = btrfs_update_inode(trans, root, inode);
 	nr = trans->blocks_used;
-- 
1.7.12.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help