btrfs: add missing setup of log for full commit at add_conflicting_inode()
authorFilipe Manana <fdmanana@suse.com>
Tue, 10 Jan 2023 14:56:36 +0000 (14:56 +0000)
committerDavid Sterba <dsterba@suse.com>
Thu, 12 Jan 2023 14:43:30 +0000 (15:43 +0100)
commit94cd63ae679973edeb5ea95ec25a54467c3e54c8
treeaf352fe0e41799de2f2d7fa55df53930f9925272
parent8bb6898da6271d82d8e76d8088d66b971a7dcfa6
btrfs: add missing setup of log for full commit at add_conflicting_inode()

When logging conflicting inodes, if we reach the maximum limit of inodes,
we return BTRFS_LOG_FORCE_COMMIT to force a transaction commit. However
we don't mark the log for full commit (with btrfs_set_log_full_commit()),
which means that once we leave the log transaction and before we commit
the transaction, some other task may sync the log, which is incomplete
as we have not logged all conflicting inodes, leading to some inconsistent
in case that log ends up being replayed.

So also call btrfs_set_log_full_commit() at add_conflicting_inode().

Fixes: e09d94c9e448 ("btrfs: log conflicting inodes without holding log mutex of the initial inode")
CC: stable@vger.kernel.org # 6.1
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c