Skip to content

Commit

Permalink
Btrfs: set hole punching time properly
Browse files Browse the repository at this point in the history
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 <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Tsutomu Itoh authored and Josef Bacik committed Dec 12, 2012
1 parent d03f918 commit e1f5790
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,9 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
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;
Expand Down

0 comments on commit e1f5790

Please sign in to comment.