On Mon, Apr 28, 2025 at 02:59:03AM +0800, Kairui Song wrote: > folio_index is only needed for mixed usage of page cache and swap > cache, for pure page cache usage, the caller can just use > folio->index instead. > > It can't be a swap cache folio here. Swap mapping may only call into fs > through `swap_rw` and that is not supported for fuse. So just drop it > and use folio->index instead. > > uigned-off-by: Kairui Song <kasong@xxxxxxxxxxx> > Cc: Miklos Szeredi <miklos@xxxxxxxxxx> > Cc: Joanne Koong <joannelkoong@xxxxxxxxx> > Cc: Josef Bacik <josef@xxxxxxxxxxxxxx> > Cc: linux-fsdevel@xxxxxxxxxxxxxxx > Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx> Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> > @@ -2349,7 +2349,7 @@ static bool fuse_writepage_need_send(struct fuse_conn *fc, struct folio *folio, > return true; > > /* Discontinuity */ > - if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio_index(folio)) > + if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio->index) > return true; This looks like a pre-existing bug. - if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio_index(folio)) + prev_folio = data->orig_folios[ap->num_folios - 1]; + if (prev_folio->index + folio_nr_pages(prev_folio) != folio->index) return true;