]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
erofs: fix PSI memstall accounting
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 27 Nov 2024 08:52:36 +0000 (16:52 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 12 Dec 2024 16:24:40 +0000 (00:24 +0800)
Max Kellermann recently reported psi_group_cpu.tasks[NR_MEMSTALL] is
incorrect in the 6.11.9 kernel.

The root cause appears to be that, since the problematic commit, bio
can be NULL, causing psi_memstall_leave() to be skipped in
z_erofs_submit_queue().

Reported-by: Max Kellermann <max.kellermann@ionos.com>
Closes: https://lore.kernel.org/r/CAKPOu+8tvSowiJADW2RuKyofL_CSkm_SuyZA7ME5vMLWmL6pqw@mail.gmail.com
Fixes: 9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted images properly")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241127085236.3538334-1-hsiangkao@linux.alibaba.com
fs/erofs/zdata.c

index 01f14750548745803e7357c765ea9e1ee18ebae1..19ef4ff2a1345d6716d906747334141a5c04f5d7 100644 (file)
@@ -1792,9 +1792,9 @@ drain_io:
                        erofs_fscache_submit_bio(bio);
                else
                        submit_bio(bio);
-               if (memstall)
-                       psi_memstall_leave(&pflags);
        }
+       if (memstall)
+               psi_memstall_leave(&pflags);
 
        /*
         * although background is preferred, no one is pending for submission.