On Mon, Aug 19, 2024 at 7:10 PM Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx> wrote: > > > > On 8/20/24 2:24 AM, Joanne Koong wrote: > > In the case where the aux writeback list is dropped (eg the pages > > have been truncated or the connection is broken), the stats for > > its pages and backing device info need to be updated as well. > > > > Fixes: e2653bd53a98 ("fuse: fix leaked aux requests") > > Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx> > > --- > > fs/fuse/file.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/fs/fuse/file.c b/fs/fuse/file.c > > index 63fd5fc6872e..7ac56be5fee6 100644 > > --- a/fs/fuse/file.c > > +++ b/fs/fuse/file.c > > @@ -1831,10 +1831,11 @@ __acquires(fi->lock) > > fuse_writepage_finish(wpa); > > spin_unlock(&fi->lock); > > > > - /* After fuse_writepage_finish() aux request list is private */ > > + /* After rb_erase() aux request list is private */ > > for (aux = wpa->next; aux; aux = next) { > > next = aux->next; > > aux->next = NULL; > > + fuse_writepage_finish(aux); > > fuse_writepage_free(aux); > > } > > > > LGTM. > > Besides, there is similar logic of decreasing stats info for replaced > aux (temp) request inside fuse_writepage_add(), though without waking up > fi->page_waitq. > > I wonder if we could factor out a new helper function, saying > fuse_writepage_dec_stat(), which could be called both from > fuse_writepage_add() and fuse_send_writepage(). This sounds good to me. I'll add this refactoring when I resubmit this patch series. Thanks, Joanne > > > -- > Thanks, > Jingbo