Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp429719rdb; Mon, 22 Jan 2024 08:27:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsFWD6bOvFKdDLEspUPy2yjSU92TgdWqNIWuL0uFRm1JV0IQQgPYFd8Ct7KNKTTKRVsbc4 X-Received: by 2002:a17:902:efc3:b0:1d5:8cbc:8ad1 with SMTP id ja3-20020a170902efc300b001d58cbc8ad1mr4544467plb.9.1705940860119; Mon, 22 Jan 2024 08:27:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705940860; cv=pass; d=google.com; s=arc-20160816; b=VMnkPYf7dKHzUjMjYW8i4PoZbI+NplfG8LKRKq1yaLgDzTfQS2savgT+LTL7+uLXGO PaPv1+80EVS4XCNYyZcNpn6JIxZUZyFyIl0Q8b6MwgVWw+F1CCvGd9B/UplqT5hmy/k9 qsiswA7vzKJ+nlD9zx/dLXwXJ+0zlLh+Wr9voA/WDAwqf+jWTfLNGKpg5JzL11UzKMnH QWm9sIQg6Ag+9diUmUotIBLUAwwxOMuA4AY/aqj46qqhpevFlEhlnGM97g1TGdbdRxv9 bVUYkT5uzUpjf/k6nehQN47PEJL+Y3E1aWc8i/1av0GLuX9kVABNGaPPpFXgWrg15jPS 7fsQ== 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=ectM4LOrI6MXXtzINOX0JL5T+KxliLSkU995ADRlNKo=; fh=wTbA8mAJCeNDYou3h447zp3bPo0xvjm9cWRqEUK9oB4=; b=0Mq7wHdvUpue0PrywT5cFnee6fnQRNhXpiu4dnF+Keg+trVpKbM9wpP/AANv0UIpwv 4G1V2UU801Y6bmwVT0bpICBI+1Ty1RyGJSOhb8yMYIdvMoSaF+AB0YG0TlMfifTxJYbg jhHCRWg/GPU43CrNv7b21dA7NQWsX4DcLi4Fpcqb6bf+D4u12TYInGEC2+ELpT1g1DRF EvoduxR4gkr7ww5nfzGiz0YcTg2WGiP5xqGaS+wDykO9acYDUK//woyNPrfTnyuqCMQf tbaM+nBKXDFEZ2fI4a+qzbrJYi9y9HE4OxhKgznl6IT6ds9MwAWDkDMSaT4kbPoP9cOI 7GKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aZd+CdPh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t18-20020a170902e85200b001d740687d15si3269152plg.496.2024.01.22.08.27.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:27:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aZd+CdPh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33429-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E8154B2C4CF for ; Mon, 22 Jan 2024 16:05:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1AAC886AEE; Mon, 22 Jan 2024 15:11:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aZd+CdPh" 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 45A6886ADC; Mon, 22 Jan 2024 15:11:03 +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=1705936263; cv=none; b=Wox4v+38eVB8AtGN8z8h9YgbCVt+Y4TETMEZ8Jvtoqyf/hNgHN+uiF3U/vrF4qw3wXaR0KlcIs0uJczmtI2QeKBQHBVS/+2jPawYGePWB6BnrOUtRcmao3Ie2nlwbfKF0BoMqCPV8D7SR8Rusbatz6TA0NDoTlrJNKsCY3LeBlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705936263; c=relaxed/simple; bh=Uuq2rRSJLTxs+pWhQ/k6UA6moVrOeLwsL+aGmFLaAy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fPW5ybHaLo/jlDDZyauZNrJVt6PKQb5pDEYCvhd5BPhsdjTFx0qCkRrTsxg5FPABTDZtj055/HU8AVmcosMvuJo+bgE0XEaa3L0q6BtlIU2HEaJndcW7MHraAl+JaJ6ZAUB3oVjbqlbILeeSva208Ig61pw0uiWF+Ilc9be85NY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aZd+CdPh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E331CC433A6; Mon, 22 Jan 2024 15:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705936262; bh=Uuq2rRSJLTxs+pWhQ/k6UA6moVrOeLwsL+aGmFLaAy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZd+CdPhX3vEiBya7N4lS1lUcjSG+gmm1vBXUjMAQrRtrOKIiwxI34M1krQ8Fh+Hv l+7RBW+JS4L4n3/V/QpHQJuVt9OhTJUDWvQpDvxQYcmDV1mEgwKI4Tmp7u+reDAYPm OXXiEq/zo2JKfHXxpSiTpBfwznalZADWO9BF/zHhqPVAlmy5mkGsFI+4ayPk8nUEw4 vjpgrnFJj7L6M0HMUyZjvdH1I0fPwqLOgRf6Rwh1N0avIS3UJxyBEdoUw80q/4xhPp 3i9Xa1wcKwXt1DW1Bv/AbbHTou69hb82GYgglQeMjrg533wgVYIdKmLhbcn+gQdq0Y xN0nkPa/fw+cg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chao Yu , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 6.1 29/53] f2fs: fix to tag gcing flag on page during block migration Date: Mon, 22 Jan 2024 10:08:30 -0500 Message-ID: <20240122150949.994249-29-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122150949.994249-1-sashal@kernel.org> References: <20240122150949.994249-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 X-stable-base: Linux 6.1.74 Content-Transfer-Encoding: 8bit From: Chao Yu [ Upstream commit 4961acdd65c956e97c1a000c82d91a8c1cdbe44b ] It needs to add missing gcing flag on page during block migration, in order to garantee migrated data be persisted during checkpoint, otherwise out-of-order persistency between data and node may cause data corruption after SPOR. Similar issue was fixed by commit 2d1fe8a86bf5 ("f2fs: fix to tag gcing flag on page during file defragment"). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/compress.c | 4 +++- fs/f2fs/file.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 4cb58e8d699e..3d9f6495a4db 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1026,8 +1026,10 @@ static void set_cluster_dirty(struct compress_ctx *cc) int i; for (i = 0; i < cc->cluster_size; i++) - if (cc->rpages[i]) + if (cc->rpages[i]) { set_page_dirty(cc->rpages[i]); + set_page_private_gcing(cc->rpages[i]); + } } static int prepare_compress_overwrite(struct compress_ctx *cc, diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 9b9fb3c57ec6..d69abe32d91d 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1326,6 +1326,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, } memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE); set_page_dirty(pdst); + set_page_private_gcing(pdst); f2fs_put_page(pdst, 1); f2fs_put_page(psrc, 1); @@ -4032,6 +4033,7 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len) f2fs_bug_on(F2FS_I_SB(inode), !page); set_page_dirty(page); + set_page_private_gcing(page); f2fs_put_page(page, 1); f2fs_put_page(page, 0); } -- 2.43.0