]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "Btrfs: race free update of commit root for ro snapshots"
authorChris Mason <clm@fb.com>
Wed, 15 Oct 2014 20:50:56 +0000 (13:50 -0700)
committerChris Mason <clm@fb.com>
Fri, 17 Oct 2014 09:40:59 +0000 (02:40 -0700)
commit17e222d7a280802997577872a30b82d3e01edddf
treef9e444a57d37d65fe2458134249cc086bf92d6de
parent3025d6f3c0f95d005277eeb691cf2224d1c7f4a2
Revert "Btrfs: race free update of commit root for ro snapshots"

This reverts commit c141be147cd302914954f94f054d152428efc1fe.

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: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c
fs/btrfs/ioctl.c