From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A2C9022333E; Thu, 12 Dec 2024 16:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734019685; cv=none; b=QWAZfZVLWyJDTgg5eH2CYA6P1rJhgj94zSNPgL4EbMVEdo40QD+u5POaOYKyp2DaGH1MeCdTHP/7ijcZIxGPW/pgBm3C3pEAec3JrdsSMLjkPKgGQN1dxucJDWbikFzjeZcjzleE3TzZO9aBSHcqoh9JskHk7J3AKYXS/ZJiQ5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734019685; c=relaxed/simple; bh=1HPpKTuVPmdXCFalOONYr2WVtYj+he0DEXEymsobQgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Je7xyKQ2fnYUvu8BCu8FJOXgZ9iENGiWRQJGfOvKV+/L35B2EYrZWNA4UQAJyLzYu8t9fGRJOcKWU87GjbfUYfQXnXMTjA1S3I6Sy9Po8zt2V9DLQERtL2I6DZq0e0sClhoZaeF3K0O4CIWjiVdhVPG0V9txBx9xXM6mYDkMXIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SAlUnYUf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SAlUnYUf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15956C4CECE; Thu, 12 Dec 2024 16:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734019685; bh=1HPpKTuVPmdXCFalOONYr2WVtYj+he0DEXEymsobQgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SAlUnYUf1u+YkDY4Oab+y/QZ7o8kSLMq5D7yxd3NM5VXbSCyF/VcWi+GQC07x1BhV VONboDkFkaVuE/d7VudCfnA51ImnQve7e4/KhbnWnkX/L9s2Eua70ESWrYSb3SHFWR KbedJQcGp5es1dIpri4/wAK96pdLYoemGnV5S834= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, LongPing Wei , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.1 272/772] f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block Date: Thu, 12 Dec 2024 15:53:37 +0100 Message-ID: <20241212144401.153179969@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144349.797589255@linuxfoundation.org> References: <20241212144349.797589255@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: LongPing Wei [ Upstream commit c3af1f13476ec23fd99c98d060a89be28c1e8871 ] This f2fs_bug_on was introduced by commit 2c1905042c8c ("f2fs: check segment type in __f2fs_replace_block") when there were only 6 curseg types. After commit d0b9e42ab615 ("f2fs: introduce inmem curseg") was introduced, the condition should be changed to checking curseg->seg_type. Fixes: d0b9e42ab615 ("f2fs: introduce inmem curseg") Signed-off-by: LongPing Wei Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 947849e66b0a7..64609b6e47617 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3543,8 +3543,8 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, } } - f2fs_bug_on(sbi, !IS_DATASEG(type)); curseg = CURSEG_I(sbi, type); + f2fs_bug_on(sbi, !IS_DATASEG(curseg->seg_type)); mutex_lock(&curseg->curseg_mutex); down_write(&sit_i->sentry_lock); -- 2.43.0