From nobody Fri Dec 19 11:33:59 2025 Received: from mail-gw02.astralinux.ru (mail-gw02.astralinux.ru [195.16.41.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B6401EEA36; Tue, 4 Mar 2025 11:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.16.41.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741086391; cv=none; b=s5OzrJ2Yu7QZbZ1L1NXDar/mIF0FxiVEM/LtZCMTUSGdFCuRxkllynt8lh8+c5kQRWcOew8w/Rga0Dwgv8nBB05wxevXbA6rJSgkD2Nxlc1bPVHeG+nyRdtq67utzJ/LPSStveCKBazMgokyDTX2FJdsQyExzX6i0BH+XFpNiuM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741086391; c=relaxed/simple; bh=IP9g1eSFTx9/9l1F3zGbiHkCg+HxQDS6R0GpeyAaTeA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e+kav5+wdqefUbe4v6oM/dIVBGgOSgMtzsVQqs6/553Q9BWuYdkahgem5SDq6ynocJ+079/W5XTDQbD0uCtZLAKE/jmvySZPAEJthKxil498EDhQnZUNCwg5KfdjvlyIwlc8KTnvvDp/28TAdqbmOUBqY8Z6OVB8kd7GpmWhqzw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru; spf=pass smtp.mailfrom=astralinux.ru; arc=none smtp.client-ip=195.16.41.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=astralinux.ru Received: from gca-msk-a-srv-ksmg01.astralinux.ru (localhost [127.0.0.1]) by mail-gw02.astralinux.ru (Postfix) with ESMTP id 9C0191F9EB; Tue, 4 Mar 2025 14:06:20 +0300 (MSK) Received: from new-mail.astralinux.ru (gca-yc-ruca-srv-mail04.astralinux.ru [10.177.185.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail-gw02.astralinux.ru (Postfix) with ESMTPS; Tue, 4 Mar 2025 14:06:19 +0300 (MSK) Received: from rbta-msk-lt-156703.astralinux.ru (unknown [10.177.20.114]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4Z6XtL4skQzkX1p; Tue, 4 Mar 2025 14:06:18 +0300 (MSK) From: Alexey Panov To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Alexey Panov , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Gao Xiang , Max Kellermann Subject: [PATCH v2 6.1 2/2] erofs: fix PSI memstall accounting Date: Tue, 4 Mar 2025 14:05:58 +0300 Message-Id: <20250304110558.8315-3-apanov@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250304110558.8315-1-apanov@astralinux.ru> References: <20250304110558.8315-1-apanov@astralinux.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-KSMG-AntiPhishing: NotDetected, bases: 2025/03/04 09:15:00 X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Envelope-From: apanov@astralinux.ru X-KSMG-AntiSpam-Info: LuaCore: 51 0.3.51 68896fb0083a027476849bf400a331a2d5d94398, {Tracking_uf_ne_domains}, {Tracking_internal2}, {Tracking_from_domain_doesnt_match_to}, lore.kernel.org:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;new-mail.astralinux.ru:7.1.1;127.0.0.199:7.1.2;astralinux.ru:7.1.1, FromAlignment: s X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiSpam-Lua-Profiles: 191452 [Mar 04 2025] X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Version: 6.1.1.11 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/03/04 09:41:00 #27591543 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected, bases: 2025/03/04 09:15:00 X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 Content-Type: text/plain; charset="utf-8" From: Gao Xiang commit 1a2180f6859c73c674809f9f82e36c94084682ba upstream. 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 Closes: https://lore.kernel.org/r/CAKPOu+8tvSowiJADW2RuKyofL_CSkm_SuyZA7ME5= vMLWmL6pqw@mail.gmail.com Fixes: 9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted ima= ges properly") Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20241127085236.3538334-1-hsiangkao@linux.al= ibaba.com Signed-off-by: Alexey Panov --- fs/erofs/zdata.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index ac01c0ede7f7..d175b5d0a2f5 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1589,11 +1589,10 @@ static void z_erofs_submit_queue(struct z_erofs_dec= ompress_frontend *f, move_to_bypass_jobqueue(pcl, qtail, owned_head); } while (owned_head !=3D Z_EROFS_PCLUSTER_TAIL); =20 - if (bio) { + if (bio) submit_bio(bio); - if (memstall) - psi_memstall_leave(&pflags); - } + if (memstall) + psi_memstall_leave(&pflags); =20 /* * although background is preferred, no one is pending for submission. --=20 2.39.5