]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix nodatasum handling in balancing code
authorYan Zheng <zheng.yan@oracle.com>
Fri, 12 Dec 2008 15:03:38 +0000 (10:03 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 12 Dec 2008 15:03:38 +0000 (10:03 -0500)
commit31ce1d70b3e8172a05f34d6127f60d835b006310
tree4e2e716400cc45a6697475629f4c046b96ff76e7
parent6db935d71cee551dd00101932964b9c81bfe6a0f
Btrfs: fix nodatasum handling in balancing code

Checksums on data can be disabled by mount option, so it's
possible some data extents don't have checksums or have
invalid checksums. This causes trouble for data relocation.
This patch contains following things to make data relocation
work.

1) make nodatasum/nodatacow mount option only affects new
files. Checksums and COW on data are only controlled by the
inode flags.

2) check the existence of checksum in the nodatacow checker.
If checksums exist, force COW the data extent. This ensure that
checksum for a given block is either valid or does not exist.

3) update data relocation code to properly handle the case
of checksum missing.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
fs/btrfs/compression.c
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.h
fs/btrfs/file-item.c
fs/btrfs/file.c
fs/btrfs/inode.c