Re: [PATCH] fs/btrfs: Fix raid6 qstripe kmap'ing

From: Ira Weiny
Date: Fri Feb 05 2021 - 11:44:37 EST


On Fri, Feb 05, 2021 at 04:34:41PM +0100, David Sterba wrote:
> On Thu, Feb 04, 2021 at 07:52:36PM -0800, Ira Weiny wrote:
> > On Thu, Feb 04, 2021 at 04:26:08PM +0100, David Sterba wrote:
> > > On Wed, Feb 03, 2021 at 04:56:48PM +0100, David Sterba wrote:
> > > > On Wed, Jan 27, 2021 at 10:15:03PM -0800, ira.weiny@xxxxxxxxx wrote:
> > > > > From: Ira Weiny <ira.weiny@xxxxxxxxx>
> > > > Changelog is good, thanks. I've added stable tags as the missing unmap
> > > > is a potential problem.
> > >
> > > There are lots of tests faling, stack traces like below. I haven't seen
> > > anything obvious in the patch so that needs a closer look and for the
> > > time being I can't add the patch to for-next.
> >
> > :-(
> >
> > I think I may have been off by 1 on the raid6 kmap...
> >
> > Something like this should fix it...
> >
> > diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
> > index b8a39dad0f00..dbf52f1a379d 100644
> > --- a/fs/btrfs/raid56.c
> > +++ b/fs/btrfs/raid56.c
> > @@ -2370,7 +2370,7 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
> > goto cleanup;
> > }
> > SetPageUptodate(q_page);
> > - pointers[rbio->real_stripes] = kmap(q_page);
> > + pointers[rbio->real_stripes - 1] = kmap(q_page);
>
> Oh right and tests agree it works.
>
> > }
> >
> > atomic_set(&rbio->error, 0);
> >
> > Let me roll a new version.
>
> No need to, I'll fold the fixup. Thanks.

Oh cool thanks! :-D
Ira