Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp729950imm; Thu, 13 Sep 2018 06:57:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbq1u2NZRRtSUZZDrIgFq0M3k4yOSLDmsbq7D23Np26sM3Rq5/ZaxpqpRhJ3cqIz6BgMjRE X-Received: by 2002:a62:d94:: with SMTP id 20-v6mr7613805pfn.202.1536847050027; Thu, 13 Sep 2018 06:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847049; cv=none; d=google.com; s=arc-20160816; b=RUbM6ABr/zNSfA51eVbuc6Zee4XwI3EsuRM5MiY+7neNP0U8gnpNmAuJjE1591srLp PUW2sQoih8dKtaJsIZrX42hjoj+FrzJvPOTniR65DYHy+UkRxBuPaBxUmjyuIfl+uK8M FYgWA3ax9R0xlC7vwc/VjhFVfvWgwCOJuTKvmAhAtCQw3U04j0raoh/J9ANCDQVokBK3 cNzBSORMVkUVm3Jxec04WmavVYwEysXm8w4tq07JmNBm+jlPje5yK0MsaymsVXMI/ZCX yPD+KVm4EVdPS/6IDHR68JYGmKCS6J2/qOx/9fznBKmH71sCgRIDJnJpWLOUitxIKzxR 4nqw== 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; bh=H2JrCRFAFhD09saJ3uCa/Rk+I7sdqLeGTiuC7vBANs0=; b=ccxOPMeLHuOTKC8PrNIPqPtjTJ0/8+bp5nMSbtDQIEZHy6oZoNO3kfiK+Wqmf6RG42 QkX51KWq1kXOx/gvRtWQMbCq45AcvuntwmIXr7WOV4lIrWTtwpb/PLIW4ylqmVL09xhm NTSPTL5TdhdfjEG3OyG5cVpoaxtoCo81hWTFJJj/d3BO46e9Iqhflgk4j7whJqSHv65s P/j6HlnCsmeQOh+dC2CVzkvuDRRZESrgCBHIXE9FqSQBPB/jkT/lFTBc5fkMADGrUNlK /2VN7v6uxb/NKhleTAVfocB0hmLeyL+wSLlc0QiXIrjb7ZVMwTNftbmEvuA+KhOXORN8 7ZyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t21-v6si3956978plj.261.2018.09.13.06.57.15; Thu, 13 Sep 2018 06:57:29 -0700 (PDT) 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; 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 S1731441AbeIMTGp (ORCPT + 99 others); Thu, 13 Sep 2018 15:06:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34276 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728951AbeIMTGp (ORCPT ); Thu, 13 Sep 2018 15:06:45 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 39B6ED19; Thu, 13 Sep 2018 13:57:07 +0000 (UTC) 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.18 095/197] f2fs: fix to clear PG_checked flag in set_page_dirty() Date: Thu, 13 Sep 2018 15:30:44 +0200 Message-Id: <20180913131845.337084324@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chao Yu [ Upstream commit 66110abc4c931f879d70e83e1281f891699364bf ] PG_checked flag will be set on data page during GC, later, we can recognize such page by the flag and migrate page to cold segment. But previously, we don't clear this flag when invalidating data page, after page redirtying, we will write it into wrong log. Let's clear PG_checked flag in set_page_dirty() to avoid this. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/data.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2494,6 +2494,10 @@ static int f2fs_set_data_page_dirty(stru if (!PageUptodate(page)) SetPageUptodate(page); + /* don't remain PG_checked flag which was set during GC */ + if (is_cold_data(page)) + clear_cold_data(page); + if (f2fs_is_atomic_file(inode) && !f2fs_is_commit_atomic_write(inode)) { if (!IS_ATOMIC_WRITTEN_PAGE(page)) { f2fs_register_inmem_page(inode, page);