Re: [syzbot] BUG: sleeping function called from invalid context in folio_copy

From: Matthew Wilcox
Date: Mon Jul 26 2021 - 08:47:31 EST


On Sun, Jul 25, 2021 at 10:18:34PM -0700, Andrew Morton wrote:
> (Cc Matthew)
>
> (It might not be a folio thing at all - I haven't checked yet)

Already fixed, thanks. folio_copy() had a cond_resched() in it,
even if it was only copying a single page. Now it only calls
cond_resched() if it's copying more than one page.

We discussed this in the folio call on Friday, because we're leaving a
bit of a landmine here for whoever tries to make multi-page folios work
with buffer_heads. There's not much we can do about it for now; it'll
just be one of the many problems to be dealt with. Hopefully filesystems
will convert to iomap instead of trying to make buffer_heads support
multiple pages.