]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: Separate finding-right-mirror and writing-to-target's process in scrub_handle_...
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 20 Jan 2015 07:11:40 +0000 (15:11 +0800)
committerChris Mason <clm@fb.com>
Thu, 22 Jan 2015 02:06:49 +0000 (18:06 -0800)
commita060599afd2fc871d33fbf3885a70e5f9447fb9e
tree5a62834b17957c5ec0bb274799864e4274a11eb6
parentf06274ab3129e0de543df18c69fe826681b5af1d
Btrfs: Separate finding-right-mirror and writing-to-target's process in scrub_handle_errored_block()

In corrent code, code of finding-right-mirror and writing-to-target
are mixed in logic, if we find a right mirror but failed in writing
to target, it will treat as "hadn't found right block", and fill the
target with sblock_bad.

Actually, "failed in writing to target" does not mean "source
block is wrong", this patch separate above two condition in logic,
and do some cleanup to make code clean.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/scrub.c