Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2398042lqp; Sun, 24 Mar 2024 17:46:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+UyW3a2e6P/iio8b4Wp7R8uhvGCYqCVFgJeBC+P2mPlOsCOi2/jXDwOjF77BiHTlB9bOjAV6yzoVQuzUPavOp/AUKz3+g/xf05NGNZQ== X-Google-Smtp-Source: AGHT+IEt5Q8tvD7ikSwl7KvXSxYZ+VKEYcwyNQpLm4xAe+s7hQ0KNy3m9hrPklw7eDIthB25U3xe X-Received: by 2002:a05:620a:36f4:b0:788:26bb:1378 with SMTP id cz52-20020a05620a36f400b0078826bb1378mr5623492qkb.73.1711327568215; Sun, 24 Mar 2024 17:46:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327568; cv=pass; d=google.com; s=arc-20160816; b=jZMxwZFFfBKbne8bbAcR/rRC1lzj3p3OGI26Pjvszb0QEFdRqcT01SJnvhPoV1RmzP VXEYxY1ox2Wh0xktmrcD6g0mnVu1D3s7W/ZABedTE3lGD9NBcYX4zIyMi2juQ66UeRer fXbFCtMVWaaPGGN05A3VhE621MgrfbFlYnHfYfsqQys50+TREoKhpWgR1AL58yEZa2su eUa+M+hG+OHczNqCYTXT58F5Gf79AxLd9L2gOsBHSZnJU6Wef2GAeW3GEloeLNhR8IWf /h/lukjOtaz3UqbwuT8CKq7QGVP3HK/maZ1uNOIenWvxBGNalKBS7OBvGVv1SlMxtUK7 O6Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=o8lgREOhpKU1kff/xla8KZCu7pWU7u+99uR5RpiGkfo=; fh=12a/sEIKzFufS840P/8mjdllY8V10TQux2Vn471Up2g=; b=OeF0FFCzpMw8ZIc+0SP5rYFK6K+k3wGq4WpVE7/zF/xeGBk8K+POADJC5x/kA9iY+k ypLTRI6YazEh9avC5kr3uJmsnjdkryVr7+gPlzYcm/7U86X1OFfoyWprWN81k6kypeKE yhGEiyRQGAtSw+yuWSCsTQnrVvno4YTobzGz6k7SK41n2zXfQMmkzNLinLrlMcQzyfHv FHtLsQ1hXy3NxG9ociXjX/w5voVe+cM36fqzaw7YfePt3AolIAIZSfiwvlNKME1uEmjA 9THuGhMcqV4dYqi0FU/mPijltzhXEsFwIneuvNjPg7GfIYQyfiUCM3Zga1kblAFDS+9u dHKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZurLnNWt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g10-20020ae9e10a000000b0078a3a8e731bsi4432894qkm.52.2024.03.24.17.46.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZurLnNWt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E8E8F1C23F51 for ; Mon, 25 Mar 2024 00:46:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EBA31B4528; Sun, 24 Mar 2024 22:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZurLnNWt" 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 8022C1B450A; Sun, 24 Mar 2024 22:44:35 +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=1711320275; cv=none; b=g9VdYShftyFp3iID+FlppvfheAopbhZstELdeLPXF6Dn47jGOICv5ZyzqDSdsaY0JLPbHrWCXNezVNsnBBATN9IFz6V9s5eooyA+5I2962OJE8xzeZFV+0GXjVa0JVvE1VqCVo+66SKh3Y5wG11UQe2SOUe3Qv5VEA/PUqHnO2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320275; c=relaxed/simple; bh=Cf9FS8dK+OhDjAn/jaSTG4fEILd5Xjj77aPsV2aCYBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eDtqvxYBo3reVcmZM6ihzy8rss3zlTf2H9trt1fAv0BC6MhHC6KNKs368y8pbmnL/WReq06z6ROnAvuHQGaUUj6kZQzPWAhQr8i2cCoTXxTYmv1qA81Z772O/NajcTIuhEd76WkHrQNVBN1hXYDkrzdVcso9BL9zMsuDjUCZ4mU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZurLnNWt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 772D3C433C7; Sun, 24 Mar 2024 22:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320275; bh=Cf9FS8dK+OhDjAn/jaSTG4fEILd5Xjj77aPsV2aCYBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZurLnNWtvG0xA6NwQp51qhOGgyafoQ3/V+LU8Hmv2q4D1rgmYlc5a88sCjUiz5tOG 90AiUnjyWLg/wn/v6f76eYCoz7rsnoZklNJ6pDMT1456HeqKkTF0SZi4hsiLriHENd /lUFcNSGjHt42iShymzb23Qt2lBMxb2g6uiSlnCmzFWU6QUrCga48cxsZEAzMDS9nq jaDacQR5eg6cePl3uYVP8mlppKFrHJbVqMt+1e/ly/GSGOM2Mkng2zxsFH5XtXtZdd hcVjshDMaBIFP4ku/KWGgzVD31Nls9kkCSu46pZoIyxWHQcj3inf+R7uc8NVs9QFMQ OXwYBWERI5jXg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.8 583/715] f2fs: fix to use correct segment type in f2fs_allocate_data_block() Date: Sun, 24 Mar 2024 18:32:42 -0400 Message-ID: <20240324223455.1342824-584-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Chao Yu [ Upstream commit 7324858237829733dec9c670170df2377c5ca6e2 ] @type in f2fs_allocate_data_block() indicates log header's type, it can be CURSEG_COLD_DATA_PINNED or CURSEG_ALL_DATA_ATGC, rather than type of data/node, however IS_DATASEG()/IS_NODESEG() only accept later one, fix it. Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/segment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ef5b3848426b0..77409e3665954 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3491,12 +3491,12 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, locate_dirty_segment(sbi, GET_SEGNO(sbi, old_blkaddr)); locate_dirty_segment(sbi, GET_SEGNO(sbi, *new_blkaddr)); - if (IS_DATASEG(type)) + if (IS_DATASEG(curseg->seg_type)) atomic64_inc(&sbi->allocated_data_blocks); up_write(&sit_i->sentry_lock); - if (page && IS_NODESEG(type)) { + if (page && IS_NODESEG(curseg->seg_type)) { fill_node_footer_blkaddr(page, NEXT_FREE_BLKADDR(sbi, curseg)); f2fs_inode_chksum_set(sbi, page); -- 2.43.0