From: Joanne Koong Date: Mon, 26 Aug 2024 21:19:04 +0000 (-0700) Subject: fuse: update stats for pages in dropped aux writeback list X-Git-Tag: v5.10.226~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d38c704b4254b0c19b93cfc7df3065a73c9958f;p=thirdparty%2Fkernel%2Fstable.git fuse: update stats for pages in dropped aux writeback list commit f7790d67785302b3116bbbfda62a5a44524601a3 upstream. In the case where the aux writeback list is dropped (e.g. 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 Reviewed-by: Josef Bacik Cc: # v5.1 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 13d97547eaf6c..fd7263ed25b92 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1692,10 +1692,16 @@ __acquires(fi->lock) fuse_writepage_finish(fm, 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) { + struct backing_dev_info *bdi = inode_to_bdi(aux->inode); + next = aux->next; aux->next = NULL; + + dec_wb_stat(&bdi->wb, WB_WRITEBACK); + dec_node_page_state(aux->ia.ap.pages[0], NR_WRITEBACK_TEMP); + wb_writeout_inc(&bdi->wb); fuse_writepage_free(aux); }