]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: scrub
authorArne Jansen <sensille@gmx.net>
Tue, 8 Mar 2011 13:14:00 +0000 (14:14 +0100)
committerArne Jansen <sensille@gmx.net>
Thu, 12 May 2011 12:45:20 +0000 (14:45 +0200)
commit91c2a16c5fd65188966679724a4fc6081e8bc693
treed88817bc7aba94e7efea530efac5ef190c1b799c
parentb7b723f3b5a491b62ddff547492e5c874477456b
btrfs: scrub

This adds an initial implementation for scrub. It works quite
straightforward. The usermode issues an ioctl for each device in the
fs. For each device, it enumerates the allocated device chunks. For
each chunk, the contained extents are enumerated and the data checksums
fetched. The extents are read sequentially and the checksums verified.
If an error occurs (checksum or EIO), a good copy is searched for. If
one is found, the bad copy will be rewritten.
All enumerations happen from the commit roots. During a transaction
commit, the scrubs get paused and afterwards continue from the new
roots.

This commit is based on the series originally posted to linux-btrfs
with some improvements that resulted from comments from David Sterba,
Ilya Dryomov and Jan Schmidt.

Signed-off-by: Arne Jansen <sensille@gmx.net>
12 files changed:
fs/btrfs/Makefile
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/file-item.c
fs/btrfs/inode.c
fs/btrfs/ioctl.h
fs/btrfs/relocation.c
fs/btrfs/scrub.c [new file with mode: 0644]
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h