]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 01:33:57 +0000 (20:33 -0500)
commit42f694b954ee6023aac90aaa864ef8c97d04c25b
treeede5e8f5af5ad990149c8206fe91d2e73eba7066
parent8fbd94b1d2bdf9c05e92000600343d3eb9f998fa
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>
(cherry picked from commit 4a54c8c165b66300830a67349fc7595e3fc442f7)
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c