Re: [PATCH] netfs: Add a check for NULL folioq in netfs_writeback_unlock_folios
From: David Howells
Date: Thu Oct 31 2024 - 10:06:45 EST
Chang Yu <marcus.yu.56@xxxxxxxxx> wrote:
> I see. This might be a stupid question, but is it ever possible that we have
> exactly one folioq and at the same time
>
> slot >= folioq_nr_slots(folioq)
>
> is true? Then I imagine netfs_delete_buffer_head would return NULL and
> cause the bug to trigger as well?
Whilst it is possible for "slot >= folioq_nr_slots(folioq)" to be true on what
is currently the last folioq, wreq->cleaned_to suggests that there must be
still-locked folios in the queue:
unsigned long long clean_to = min(wreq->collected_to, wreq->contiguity);
if (wreq->cleaned_to < clean_to)
netfs_writeback_unlock_folios(wreq, clean_to, ¬es);
David