]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix wrong super generation mismatch when scrubbing supers
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Wed, 4 Dec 2013 13:15:19 +0000 (21:15 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:19:52 +0000 (13:19 -0800)
commit604480f6e38d20628eed6e043713037201f9a4df
tree211cab1032216d0cea1ebd12b866225f73fd91dc
parentb7a78344b1fd7826ed1ad228cc02b1c696b592bd
Btrfs: fix wrong super generation mismatch when scrubbing supers

We came a race condition when scrubbing superblocks, the story is:

In commiting transaction, we will update @last_trans_commited after
writting superblocks, if scrubber start after writting superblocks
and before updating @last_trans_commited, generation mismatch happens!

We fix this by checking @scrub_pause_req, and we won't start a srubber
until commiting transaction is finished.(after btrfs_scrub_continue()
finished.)

Reported-by: Sebastian Ochmann <ochmann@informatik.uni-bonn.de>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/scrub.c