Re: [PATCH 08/19] btrfs: make unmirroed BGs readonly only if we have at least one writable BG
From: Josef Bacik
Date: Tue Jun 18 2019 - 09:40:22 EST
On Tue, Jun 18, 2019 at 07:42:46AM +0000, Naohiro Aota wrote:
> On 2019/06/13 23:09, Josef Bacik wrote:
> > On Fri, Jun 07, 2019 at 10:10:14PM +0900, Naohiro Aota wrote:
> >> If the btrfs volume has mirrored block groups, it unconditionally makes
> >> un-mirrored block groups read only. When we have mirrored block groups, but
> >> don't have writable block groups, this will drop all writable block groups.
> >> So, check if we have at least one writable mirrored block group before
> >> setting un-mirrored block groups read only.
> >>
> >
> > I don't understand why you want this. Thanks,
> >
> > Josef
> >
>
> This is necessary to handle e.g. btrfs/124 case.
>
> When we mount degraded RAID1 FS and write to it, and then
> re-mount with full device, the write pointers of corresponding
> zones of written BG differ. The patch 07 mark such block group
> as "wp_broken" and make it read only. In this situation, we only
> have read only RAID1 BGs because of "wp_broken" and un-mirrored BGs
> are also marked read only, because we have RAID1 BGs.
> As a result, all the BGs are now read only, so that we
> cannot even start the rebalance to fix the situation.
Ah ok, please add this explanation to the changelog. Thanks,
Josef