diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 5370152ea7e3..b455bdf46faa 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2711,6 +2711,11 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) * for detecting, at fsync time, if the inode isn't yet in the * log tree or it's there but not up to date. */ + struct timespec64 now = current_time(inode); + + inode_inc_iversion(inode); + inode->i_mtime = now; + inode->i_ctime = now; trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { err = PTR_ERR(trans);