[Linux-cachefs] [PATCH] netfs: Fix missing xas_retry() calls in xarray iteration
David Howells
dhowells at redhat.com
Fri Nov 4 15:34:25 UTC 2022
Matthew Wilcox <willy at infradead.org> wrote:
> "unsigned int" assumes that the number of bytes isn't going to exceed 32
> bits. I tend to err on the side of safety here and use size_t.
Not unreasonable.
> > + pgpos = (folio_index(folio) - start_page) * PAGE_SIZE;
> > + pgend = pgpos + folio_size(folio);
>
> What happens if start_page is somewhere inside folio? Seems to me
> that pgend ends up overhanging into the next folio?
Yeah, I think my maths is dodgy. I should probably use folio_pos() and/or
offset_in_folio().
David
More information about the Linux-cachefs
mailing list