]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: avoid delayed metadata items during commits
authorChris Mason <chris.mason@oracle.com>
Fri, 17 Jun 2011 20:14:09 +0000 (16:14 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 17 Jun 2011 20:38:47 +0000 (16:38 -0400)
commit0d8241223a7b83bd9df6587860fb567f263b6afe
tree080d4a2a20d8d7e7ea8b36f63150827b970da715
parent0a0abe2625dff9681407bf2fcbc718595f97ecd0
Btrfs: avoid delayed metadata items during commits

Snapshot creation has two phases.  One is the initial snapshot setup,
and the second is done during commit, while nobody is allowed to modify
the root we are snapshotting.

The delayed metadata insertion code can break that rule, it does a
delayed inode update on the inode of the parent of the snapshot,
and delayed directory item insertion.

This makes sure to run the pending delayed operations before we
record the snapshot root, which avoids corruptions.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.h
fs/btrfs/transaction.c