]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: delete checksum items before marking blocks free
authorChris Mason <chris.mason@oracle.com>
Tue, 16 Dec 2008 18:51:01 +0000 (13:51 -0500)
committerChris Mason <chris.mason@oracle.com>
Tue, 16 Dec 2008 18:51:01 +0000 (13:51 -0500)
commite67fcccfe222dc76d425b57d82f88dfc87613db4
treeca599e975c92de75c98283756f80b2aa7a1879bb
parent97097d4dbb74583b68f0a8cdec30b5f5fe126a72
Btrfs: delete checksum items before marking blocks free

Btrfs maintains a cache of blocks available for allocation in ram.  The
code that frees extents was marking the extents free and then deleting
the checksum items.

This meant it was possible the extent would be reallocated before the
checksum item was actually deleted, leading to races and other
problems as the checksums were updated for the newly allocated extent.

The fix is to delete the checksum before marking the extent free.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c
fs/btrfs/file-item.c