]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: scrub: Introduce full stripe lock for RAID56
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 14 Apr 2017 00:35:54 +0000 (08:35 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Apr 2017 12:07:27 +0000 (14:07 +0200)
commit6e3b7156bebfc78e0eb90ed05185d245293b5ebf
tree918f983ce93ded51f7c8176740cdaee6f1ee7eb6
parent9376c2485ed78e09840fbb15b1f8c359be3a9cb0
btrfs: scrub: Introduce full stripe lock for RAID56

Unlike mirror based profiles, RAID5/6 recovery needs to read out the
whole full stripe.

And if we don't do proper protection, it can easily cause race condition.

Introduce 2 new functions: lock_full_stripe() and unlock_full_stripe()
for RAID5/6.
Which store a rb_tree of mutexes for full stripes, so scrub callers can
use them to lock a full stripe to avoid race.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ minor comment adjustments ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/scrub.c