]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fuse: update stats for pages in dropped aux writeback list
authorJoanne Koong <joannelkoong@gmail.com>
Mon, 26 Aug 2024 21:19:04 +0000 (14:19 -0700)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 28 Aug 2024 16:10:29 +0000 (18:10 +0200)
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 <joannelkoong@gmail.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Cc: <stable@vger.kernel.org> # v5.1
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c

index f39456c65ed7f7934a35b59e1ee8d7c5db1e90c7..ed76121f73f2e0f11067738e9eaa77ad0db4a19c 100644 (file)
@@ -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);
        }