]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Fix data checksum error cause by replace with io-load.
authorZhaolei <zhaolei@cn.fujitsu.com>
Wed, 5 Aug 2015 08:43:30 +0000 (16:43 +0800)
committerChris Mason <clm@fb.com>
Sun, 9 Aug 2015 14:07:13 +0000 (07:07 -0700)
commitfb1c732a00269aab7edf5b4a47777592b79e568f
tree66d1f6312a3a5b3c2cdfaf42bab7f2dcb6ebde63
parent399a4f16accf23d2fb0ebbded01e6035a66109f5
btrfs: Fix data checksum error cause by replace with io-load.

xfstests btrfs/070 sometimes failed.
In my test machine, its fail rate is about 30%.
In another vm(vmware), its fail rate is about 50%.

Reason:
  btrfs/070 do replace and defrag with fsstress simultaneously,
  after above operation, checksum error is found by scrub.

  Actually, it have no relationship with defrag operation, only
  replace with fsstress can trigger this bug.

  New data writen to target device have possibility rewrited by
  old data from source device by replace code in debug, to avoid
  above problem, we can set target block group to readonly in
  replace period, so new data requested by other operation will
  not write to same place with replace code.

  Before patch(4.1-rc3):
    30% failed in 100 xfstests.
  After patch:
    0% failed in 300 xfstests.

It also happened in btrfs/071 as it's another scrub with IO load tests.

Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/scrub.c
fs/btrfs/volumes.c