]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: set inode's logged_trans/last_log_commit after ranged fsync
authorFilipe Manana <fdmanana@suse.com>
Thu, 11 Sep 2014 20:22:14 +0000 (21:22 +0100)
committerChris Mason <clm@fb.com>
Tue, 16 Sep 2014 23:12:19 +0000 (16:12 -0700)
commit208688a01cac7697c0ebc409ea03dc2a59921e42
treea5aaaa434b9be066a0b236a5acfe4406c35dfd21
parentf8bca27fc44430d775f43c291373270c97bbf84a
Btrfs: set inode's logged_trans/last_log_commit after ranged fsync

When a ranged fsync finishes if there are still extent maps in the modified
list, still set the inode's logged_trans and last_log_commit. This is important
in case an inode is fsync'ed and unlinked in the same transaction, to ensure its
inode ref gets deleted from the log and the respective dentries in its parent
are deleted too from the log (if the parent directory was fsync'ed in the same
transaction).

Instead make btrfs_inode_in_log() return false if the list of modified extent
maps isn't empty.

This is an incremental on top of the v4 version of the patch:

    "Btrfs: fix fsync data loss after a ranged fsync"

which was added to its v5, but didn't make it on time.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/tree-log.c