On 2017年12月06日 06:55, Liu Bo wrote: > On Tue, Dec 05, 2017 at 07:09:25PM +0100, David Sterba wrote: >> On Tue, Dec 05, 2017 at 04:07:35PM +0800, Qu Wenruo wrote: >>>> @@ -2166,11 +2166,21 @@ int raid56_parity_recover(struct btrfs_fs_info *fs_info, struct bio *bio, >>>> } >>>> >>>> /* >>>> - * reconstruct from the q stripe if they are >>>> - * asking for mirror 3 >>>> + * Loop retry: >>>> + * for 'mirror == 2', reconstruct from all other stripes. >>> >>> What about using macro to makes the reassemble method more human readable? >> >> Yeah, that's definetelly needed and should be based on >> BTRFS_MAX_MIRRORS, not just hardcoded to 3. > > OK. > > In case of raid5/6, BTRFS_MAX_MIRRORS is an abused name, it's more a > raid1/10 concept, either BTRFS_RAID56_FULL_REBUILD or > BTRFS_RAID56_FULL_CHK is better to me, which one do you guys like? For mirror > 2 case, the mirror_num is no longer a single indicator, but a ranged iterator for later rebuild retries. Something like set_raid_fail_from_mirror_num() seems better to me. Thanks, Qu > > Thanks, > > -liubo >
Attachment:
signature.asc
Description: OpenPGP digital signature
