From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 93ED723BE; Wed, 8 Jan 2025 15:15:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736349335; cv=none; b=fsYoj0mTmz21y+bvcN74zbKT2tM7sxygQSlmFrOybfIs//U5tLE6KkPKiJIsQU5pLsF1YkmTNR1KcaZoYUsA4zbu23kWgH7+GY+mHaKCath3fxgNeIVHoFvBxHJ4S8y6zjXaEF6AfL5BHTat/azN6iEOvr8LicWFtIltsboH4R8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736349335; c=relaxed/simple; bh=HS/kYC90n7Q0bQTbBppqvCgZF0txVKQbbXrl65qWn9s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gdyFS6advGh5AUX/URu3MjM5cAuVtO9PHYuOJQzbMzMDIN0Rh/y/jPcqq2Sy+52q/TIX21g/6t+MOA7FgYWAHeCS4lPQXmFDpmF6uPw42+TVLE0DmcGQ1k3nYexXDKzKFRy3S5jrGJ5cJBjz2Nm4AIHTAfg96McVFB7G1bqcnC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=a1XDUkWt; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="a1XDUkWt" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1736349328; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=rC5m1R1hJhyi1o9ERb1jqfotWwANUnB960DqUUbF3UQ=; b=a1XDUkWtmX6QQCoXaKASlabMSvpPc92SCV12Ggod+52eaLDJGRPGILjgrkQXJXtxJliITV+MflRAcQGZEUYpnTG29HomFYak1hd4vzri9XwXqtesOwrZVQLtEPDYVZGphnJGSCXXGNCtrYtM/ByXKMl0/PMctOpqutxnm3Ys5Zc= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNEIvhk_1736349327 cluster:ay36) by smtp.aliyun-inc.com; Wed, 08 Jan 2025 23:15:27 +0800 From: Gao Xiang To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: linux-erofs@lists.ozlabs.org, LKML Subject: [PATCH 6.6.y 2/2] erofs: fix PSI memstall accounting Date: Wed, 8 Jan 2025 23:15:20 +0800 Message-ID: <20250108151520.2515903-2-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20250108151520.2515903-1-hsiangkao@linux.alibaba.com> References: <20250108151520.2515903-1-hsiangkao@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_SuyZA7ME5vMLWmL6pqw@mail.gmail.com Fixes: 9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted images properly") Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20241127085236.3538334-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang --- 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 9fa07436a4da..496e4c7c52a4 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1730,11 +1730,10 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f, move_to_bypass_jobqueue(pcl, qtail, owned_head); } while (owned_head != Z_EROFS_PCLUSTER_TAIL); - if (bio) { + if (bio) 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. -- 2.43.5