summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorMiao Xie2014-09-12 12:44:03 +0200
committerChris Mason2014-09-17 22:39:01 +0200
commit8b110e393c5a6e72d50fcdf9fa7ed8b647cfdfc9 (patch)
tree36f6b0048c79fd63c55892cd45f0b78e8c0cc15b /fs/btrfs/ctree.h
parentBtrfs: Set real mirror number for read operation on RAID0/5/6 (diff)
downloadkernel-qcow2-linux-8b110e393c5a6e72d50fcdf9fa7ed8b647cfdfc9.tar.gz
kernel-qcow2-linux-8b110e393c5a6e72d50fcdf9fa7ed8b647cfdfc9.tar.xz
kernel-qcow2-linux-8b110e393c5a6e72d50fcdf9fa7ed8b647cfdfc9.zip
Btrfs: implement repair function when direct read fails
This patch implement data repair function when direct read fails. The detail of the implementation is: - When we find the data is not right, we try to read the data from the other mirror. - When the io on the mirror ends, we will insert the endio work into the dedicated btrfs workqueue, not common read endio workqueue, because the original endio work is still blocked in the btrfs endio workqueue, if we insert the endio work of the io on the mirror into that workqueue, deadlock would happen. - After we get right data, we write it back to the corrupted mirror. - And if the data on the new mirror is still corrupted, we will try next mirror until we read right data or all the mirrors are traversed. - After the above work, we set the uptodate flag according to the result. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 0f3e4f7e454a..51ff3f8dbab9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1538,6 +1538,7 @@ struct btrfs_fs_info {
struct btrfs_workqueue *endio_workers;
struct btrfs_workqueue *endio_meta_workers;
struct btrfs_workqueue *endio_raid56_workers;
+ struct btrfs_workqueue *endio_repair_workers;
struct btrfs_workqueue *rmw_workers;
struct btrfs_workqueue *endio_meta_write_workers;
struct btrfs_workqueue *endio_write_workers;