• Filipe Manana's avatar
    btrfs: add missing setup of log for full commit at add_conflicting_inode() · 94cd63ae
    Filipe Manana authored
    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: e09d94c9 ("btrfs: log conflicting inodes without holding log mutex of the initial inode")
    CC: stable@vger.kernel.org # 6.1
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    94cd63ae
tree-log.c 210 KB