aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoanne Koong <[email protected]>2024-08-26 14:19:04 -0700
committerMiklos Szeredi <[email protected]>2024-08-28 18:10:29 +0200
commitf7790d67785302b3116bbbfda62a5a44524601a3 (patch)
tree9ddfb4a0c61e761e09ee790b5c0a30e1fe7bf811
parent76a51ac00ca2a72fe3e168b7fb0e70f75ba6f512 (diff)
fuse: update stats for pages in dropped aux writeback list
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 <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Cc: <[email protected]> # v5.1 Signed-off-by: Miklos Szeredi <[email protected]>
-rw-r--r--fs/fuse/file.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f39456c65ed7..ed76121f73f2 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1832,10 +1832,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);
}