]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Moved repair code from inode.c to extent_io.c
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Fri, 22 Jul 2011 13:41:52 +0000 (15:41 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Thu, 29 Sep 2011 11:38:42 +0000 (13:38 +0200)
commit926f5ba0c470dc2f4d2de97c6ab93c7d4899a66d
treefea3a5e86c2ee9304711e18b2557912166d6d52f
parent1870da0461000a7aa2556b485fc713bcf18cc6ca
btrfs: Moved repair code from inode.c to extent_io.c

The raid-retry code in inode.c can be generalized so that it works for
metadata as well. Thus, this patch moves it to extent_io.c and makes the
raid-retry code a raid-repair code.

Repair works that way: Whenever a read error occurs and we have more
mirrors to try, note the failed mirror, and retry another. If we find a
good one, check if we did note a failure earlier and if so, do not allow
the read to complete until after the bad sector was written with the good
data we just fetched. As we have the extent locked while reading, no one
can change the data in between.

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