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 946B510965; Sat, 3 Feb 2024 04:13:53 +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=1706933633; cv=none; b=EjYSIFDOKaTch5Q0J1Uc23DJ4RLv3qx0ghUnm+zK3gjzZIXPfJ2BHMCOM8wK3v7pHBo4JWBuQogB2YO4eHsSpBpfcYLEwDha8qvxGY94SkM+HtTOH8CA9Mdl7DDUSpkTypngLzr5Oc38G3jyP2FIaeTQ6BwC3J/c5aGm/ZQQymk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933633; c=relaxed/simple; bh=GJiRNEtdQe/LCtUr/bNbPJJSS6ey0B/dQkUpqKJ61WA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lfpcphB+B954HCi9sKFRJ736x0ub8ak6IBLca2WtxO3Pyrh868uexD6s/cng2FC2kjiJWXgvT1DCzk4dMw2YfAg90cUF4klDz/6AuZatN+rc7z6Ztl30l2sspm0SHcOYbsjf5gcPEefWDOWAgNmKWkmlGhFqm6O+xRp4NVeZITo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=em8ykU2m; 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="em8ykU2m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DC4CC433F1; Sat, 3 Feb 2024 04:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706933633; bh=GJiRNEtdQe/LCtUr/bNbPJJSS6ey0B/dQkUpqKJ61WA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=em8ykU2mF6evPn0q+ehwXTT23XfFO5fQJypbSnRieW1F2pU6DgYLNJiMgOnBU7o2H iwPnA3MKndxxit1NubK6Hd+bf/8oXiG6yb/gmWmNH4VzJqoY3IG2G+BeF8BNbVgsce rrgsofByKGA1TmejpLROv50D2ZoYCBs7w16H+u04= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 6.6 187/322] f2fs: fix to tag gcing flag on page during block migration Date: Fri, 2 Feb 2024 20:04:44 -0800 Message-ID: <20240203035405.303390124@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203035359.041730947@linuxfoundation.org> References: <20240203035359.041730947@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ 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 7514661bbfbb..372616ca8fb5 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1029,8 +1029,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 a631d706e117..dcf2d926ab59 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1317,6 +1317,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); @@ -4059,6 +4060,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