From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44F04C47DD9 for ; Mon, 22 Jan 2024 15:11:12 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rRvx9-0008RC-3I; Mon, 22 Jan 2024 15:11:11 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rRvx8-0008R6-7E for linux-f2fs-devel@lists.sourceforge.net; Mon, 22 Jan 2024 15:11:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ectM4LOrI6MXXtzINOX0JL5T+KxliLSkU995ADRlNKo=; b=PJIek9bmAnEdZewNfy1okXc5PP whTbTibCYFGXvjYHSZfjYnPoD/m4rHmb+WHDXXhmjJev9Fdi//UmAwZzBWx7Rr1cwxXWuVUQxHMuf qO40BZk3dpk8uW3KRaKBkXBYc9yCtTyQk7taExU7dbscOJrbnxc99fuUhw5IUW0YaiaQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ectM4LOrI6MXXtzINOX0JL5T+KxliLSkU995ADRlNKo=; b=dXDwm+bv1SxxLe6rseRaTdRfHU jDjf7X7qG8PJRMdihk1VpC82r0/3P7Mq4C/Nu2b4gIabNs5/y6lzOMKRcWqwJe8hPjmRGcsNlq8JW uX1Of/K7fw7bOm/2KtQ7618brmfn8dwFF9M8iqHZKAnyfx9F88HMW7r3msjNXis9GBU8=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rRvx5-0003jr-Pf for linux-f2fs-devel@lists.sourceforge.net; Mon, 22 Jan 2024 15:11:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 161C761475 for ; Mon, 22 Jan 2024 15:11:03 +0000 (UTC) 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 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> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.74 X-Headers-End: 1rRvx5-0003jr-Pf Subject: [f2fs-dev] [PATCH AUTOSEL 6.1 29/53] f2fs: fix to tag gcing flag on page during block migration X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aZd+CdPh" 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: stable@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