Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3433301imu; Sun, 11 Nov 2018 15:01:00 -0800 (PST) X-Google-Smtp-Source: AJdET5fEpPszRDXQUvHgIp8syuucRBsVlI61QW4p95d/aQmk2qbgN1TGAdPDac17SCNiWW165B4u X-Received: by 2002:a63:413:: with SMTP id 19mr15238607pge.7.1541977260222; Sun, 11 Nov 2018 15:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977260; cv=none; d=google.com; s=arc-20160816; b=Strs0l9c7NWdujfWw28nX12NQAKavK0G0Iq7Sba0QJEGRGfULovc0BP6O4rbMByKsC +qP590g9qass4MRamSDWkoAFY5qlpzuqglCaIHEgnMjWkrQ+qDkV6DstSEYakHbAsCEr kWC7upbihx4DWAzdrudEN9uO7qTwFdZlJU8H+udaBwIE1013sJnp2qWxC9Dom7ZgpEPJ cWbsx2homSJJQSJ4PFPCCx1eppKjBLkLKUpGqIE89NMfM2EPwmcX+JfY+S3DlrSqDiDW gQlLtheeFKbVYM/y3p7kDULbKtx9R08l373xf042fZKRbSp9DVcjE6dSDRh4jT7kTYMS 7kjw== 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=/GwjA+yBjPh9ZyS/5Tvd+7W6m5+6DU838ojMyOBQDxg=; b=M//lw2SWf9viKiIhXjusUAmQ6V4srAjEGAYvIcOh9mFZ40kK/H/wVMU2erBqJDROuc +POwG4f5oYWqzwjKT9GOd4EhhmbVm59AhjEPnLxD4NvQlzBGTO1vx1rFYSaqm5rcPKFm zuF2PrOazePeBUQSL5rGoPMRbQxpBhf13wIPU3Y2H+6YWIL11S3IqTAxtWVgbOJkkaGj sm/9A/g8TQ59fbFfHAzm1PDIwtVDXzUpNC+jAyksnvrKQDCOIkyCNgyvL1/PPMeXvPSD QU8TKHVJukGG/wo4NVQV4tktS3HKGmQruIgELG1c3KjMBINd7HCVBNAbLIukHG66k4/3 vRSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MXf9r2g7; 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 d3si1960158pgu.437.2018.11.11.15.00.44; Sun, 11 Nov 2018 15:01:00 -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=MXf9r2g7; 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 S2389520AbeKLIWf (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390708AbeKLIWd (ORCPT ); Mon, 12 Nov 2018 03:22:33 -0500 Received: from localhost (unknown [206.108.79.134]) (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 B6A9621582; Sun, 11 Nov 2018 22:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975556; bh=nMyRhnBXjiM8ECHLM0FxmeP0AiJuGw2SrKqUlDJZukw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MXf9r2g7WZFZdEchbnDuyATLf3wfFRFypEmooZG3lZhpzcPyCVt7mNV4nD35upnuD mf1u5iEAIneQIAaKQ3wJtiqDN/sZYV7FcCXH4j0xv3vqL1jg65nDUIKnLHNxw1fbJa VyAv0d9tOWcCbnCaUnC7YJlFXnnhq2kBr1KJ+hKs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim Subject: [PATCH 4.14 110/222] Revert "f2fs: fix to clear PG_checked flag in set_page_dirty()" Date: Sun, 11 Nov 2018 14:23:27 -0800 Message-Id: <20181111221657.650884964@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jaegeuk Kim commit 164a63fa6b384e30ceb96ed80bc7dc3379bc0960 upstream. This reverts commit 66110abc4c931f879d70e83e1281f891699364bf. If we clear the cold data flag out of the writeback flow, we can miscount -1 by end_io, which incurs a deadlock caused by all I/Os being blocked during heavy GC. Balancing F2FS Async: - IO (CP: 1, Data: -1, Flush: ( 0 0 1), Discard: ( ... GC thread: IRQ - move_data_page() - set_page_dirty() - clear_cold_data() - f2fs_write_end_io() - type = WB_DATA_TYPE(page); here, we get wrong type - dec_page_count(sbi, type); - f2fs_wait_on_page_writeback() Cc: Reported-and-Tested-by: Park Ju Hyung Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/data.c | 4 ---- 1 file changed, 4 deletions(-) --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2190,10 +2190,6 @@ 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)) { register_inmem_page(inode, page);