Btrfs: fix ctime update of on-disk inode
authorLi Zefan <lizf@cn.fujitsu.com>
Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 15 Dec 2011 15:50:37 +0000 (10:50 -0500)
commit306424cc880a0fbbdc99eee1f43d056a301a180f
tree7c6b3b851fcd325c65724f3a7875311407998a6d
parentf8e9e0b07be0464e12366631da3da73a1a62449c
Btrfs: fix ctime update of on-disk inode

To reproduce the bug:

    # touch /mnt/tmp
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:23.412105981 +0800
    # chattr +i /mnt/tmp
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:43.198105295 +0800
    # umount /mnt
    # mount /dev/loop1 /mnt
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:23.412105981 +0800

We should update ctime of in-memory inode before calling
btrfs_update_inode().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c