• Chris Mason's avatar
    Revert "Btrfs: race free update of commit root for ro snapshots" · d3797308
    Chris Mason authored
    This reverts commit 9c3b306e.
    
    Switching only one commit root during a transaction is wrong because it
    leads the fs into an inconsistent state. All commit roots should be
    switched at once, at transaction commit time, otherwise backref walking
    can often miss important references that were only accessible through
    the old commit root.  Plus, the root item for the snapshot's root wasn't
    getting updated and preventing the next transaction commit to do it.
    
    This made several users get into random corruption issues after creation
    of readonly snapshots.
    
    A regression test for xfstests will follow soon.
    
    Cc: stable@vger.kernel.org # 3.17
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    d3797308
inode.c 250 KB