]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix tree mod log rewind of ADD operations
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Fri, 22 Jun 2012 12:52:13 +0000 (14:52 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Wed, 27 Jun 2012 14:34:40 +0000 (16:34 +0200)
commitfa75d5fa37602b09786faccc6554d6d93714a9ad
tree4ff17f3a5f0cc91453298c5c494f8592ccfb3e50
parentd718eb7ad332a1c65b1f4a9d98fa2525c08de9d5
Btrfs: fix tree mod log rewind of ADD operations

When a MOD_LOG_KEY_ADD operation is rewinded, we remove the key from the
tree block. If its not the last key, removal involves a move operation.
This move operation was explicitly done before this commit.

However, at insertion time, there's a move operation before the actual
addition to make room for the new key, which is recorded in the tree mod
log as well. This means, we must drop the move operation when rewinding the
add operation, because the next operation we'll be rewinding will be the
corresponding MOD_LOG_MOVE_KEYS operation.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
fs/btrfs/ctree.c