Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5991162ybc; Wed, 27 Nov 2019 13:02:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxUE7oWZhIbgKe4vNm+1RXjRoCtic8HAcInC7NYr848EGsjoXRx3gZW+AndReSulpcIvZBJ X-Received: by 2002:a17:906:3798:: with SMTP id n24mr7639917ejc.15.1574888537921; Wed, 27 Nov 2019 13:02:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888537; cv=none; d=google.com; s=arc-20160816; b=no3/8jrv4TFwhzSApieT2pO+DtszeIh8kcVGFEGHUXQp14UCxtuzvISiwXnj3yKwib +9m9p+A2Jw5Ozygu7mtAzwnbLpEc3NiV/UVwHt74Tbw5FaXqYk/uwtj73Ah6NPy8LXB/ igOW+j4sf5ybytk8qzAIclmnRFgxlbtq/rnjzZwm1WtQhxI9S63DXhD5+wrRjFM3UP0v WpNjoUMTgllQskqKDCbbz/JGbytXznTcWhJhWKxmRwaGrZ+qJw0M7WBvEBhKt8zuw84G p2/AzhsPfAbgrMualLj0EJJZyyaUJJHwi3kXyYdQFPiIguKUiXqWhHuEgE7KrOdW3dix 0tMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z08BU7AfOBGX+acGQjNV8Z94Voxub5l1FBCxxnyVEow=; b=VE26VlpS/rQCNlPGUCX2stQ24bv3UnFQSiqBZ1KY/m6sO017jopfWgvew6LrPGevQd f6OHT7gwz4u4x0SyX0vURDnyJJ9I6c3Slj0ssERqf2hVOEtFSN+rL05jNiu3DI6yXwc8 MnWLEqZjJo3BIm3q1MURRjLtRRr43vWCHifhTXgcIun1lZh5eoQr07HTRg5NbIrrK5rc UBlU/0d1PrXVgK9fdoLDak5tRa1ZLgZI9WDFs77Oly6l1mPGhbjP+Nw38/76b6L98fs5 dMR7gHFZ0V2S7iNfyfQW31aKof7cEvDqacAs8Gm9j3sTOHU5oou9A51FQbo5beOWazoU Wxfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LGTu2/58"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si12960216edi.116.2019.11.27.13.01.54; Wed, 27 Nov 2019 13:02:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LGTu2/58"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731529AbfK0VAL (ORCPT + 99 others); Wed, 27 Nov 2019 16:00:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:51870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731525AbfK0VAJ (ORCPT ); Wed, 27 Nov 2019 16:00:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4DB820678; Wed, 27 Nov 2019 21:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888407; bh=LlG2uit9KDyM3hzOHqNGksF+oDB68gKaKas/WQtvjRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGTu2/58GEvrMYYUINhbIgs6XCZFI9vwkYeYuIhZpJGj14hA/zvuThREO0/GOCgrn 6/7LepP83fzoMscAwbiCaqxwpjJruOhp7RtOCyqFhXThdOOkt2KUMcFyeFwGjOo+qF 7eEyjhpSCNnrEEpjb+LY98W8UNtos08qsb09Btaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Weichao Guo , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.19 122/306] f2fs: fix to spread clear_cold_data() Date: Wed, 27 Nov 2019 21:29:32 +0100 Message-Id: <20191127203124.048149314@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu [ Upstream commit 2baf07818549c8bb8d7b3437e889b86eab56d38e ] We need to drop PG_checked flag on page as well when we clear PG_uptodate flag, in order to avoid treating the page as GCing one later. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/data.c | 8 +++++++- fs/f2fs/dir.c | 1 + fs/f2fs/segment.c | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3a2fd66769660..a7436ad194585 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1782,6 +1782,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio) /* This page is already truncated */ if (fio->old_blkaddr == NULL_ADDR) { ClearPageUptodate(page); + clear_cold_data(page); goto out_writepage; } got_it: @@ -1957,8 +1958,10 @@ static int __write_data_page(struct page *page, bool *submitted, out: inode_dec_dirty_pages(inode); - if (err) + if (err) { ClearPageUptodate(page); + clear_cold_data(page); + } if (wbc->for_reclaim) { f2fs_submit_merged_write_cond(sbi, inode, 0, page->index, DATA); @@ -2573,6 +2576,8 @@ void f2fs_invalidate_page(struct page *page, unsigned int offset, } } + clear_cold_data(page); + /* This is atomic written page, keep Private */ if (IS_ATOMIC_WRITTEN_PAGE(page)) return f2fs_drop_inmem_page(inode, page); @@ -2591,6 +2596,7 @@ int f2fs_release_page(struct page *page, gfp_t wait) if (IS_ATOMIC_WRITTEN_PAGE(page)) return 0; + clear_cold_data(page); set_page_private(page, 0); ClearPagePrivate(page); return 1; diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index ecc3a4e2be96d..cd611a57d04d7 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -733,6 +733,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, clear_page_dirty_for_io(page); ClearPagePrivate(page); ClearPageUptodate(page); + clear_cold_data(page); inode_dec_dirty_pages(dir); f2fs_remove_dirty_inode(dir); } diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d78009694f3fd..43a07514c3574 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -277,8 +277,10 @@ static int __revoke_inmem_pages(struct inode *inode, } next: /* we don't need to invalidate this in the sccessful status */ - if (drop || recover) + if (drop || recover) { ClearPageUptodate(page); + clear_cold_data(page); + } set_page_private(page, 0); ClearPagePrivate(page); f2fs_put_page(page, 1); -- 2.20.1