Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3479198imu; Sun, 11 Nov 2018 16:02:59 -0800 (PST) X-Google-Smtp-Source: AJdET5d0wjwKt08N0NwcBQm9oehlzFgFKFiveGswEZCZAA1C75PmKQ8KWX/OS2kiB7fQ6l1ObvZz X-Received: by 2002:a17:902:5ac6:: with SMTP id g6-v6mr1946177plm.212.1541980979526; Sun, 11 Nov 2018 16:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980979; cv=none; d=google.com; s=arc-20160816; b=uNVy3No8w84kfFsZvCDIVqcATkrhlrztGaggxS08+VrNNIQgTqFPKs/R3qaTjOl3pX FxRW2w7f3gmJFbahnrCYDdcP5pWcEnAoMwhWt63cFNR9i9eak5qQTMym2fJJIIqi27h5 +NeRasFuWxz3sROy7rT5BmT277wgzvewOIcyB6CT+szdeOP3uMQz7sATPdrvfh8aPH38 QwG0Jqwvhrqiypi2cUtDgl5CFBKFUoz82Ok77P46bSSw5P+f1auCwMyetm+QnZdEi1S7 NzaINn8dGHo3YoEataJT8+NDgjBJkWjuT4/BydCa609M4vbdDLQvc9+CfdDFueoFD3lq Za+w== 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=QNCahxSukdtj7ACF3cvFJM1UbaAEz7ocgGIv8Cjqe7s=; b=GAVPstMUAus0U2pz8jCQkS+DEpJ5oq+usas3ttNi5uvupRIwUceQxg6Tw8xonPhI3c EpOL8vk1MGWtZgOtN1N1ZhpXTGsPMmsf6GxCzc895SutPeCPfVfU/RnQZunfOb23zUAk 4ooNymWCcJk5Uol2H32FJL280cdeLTICB38K18GDWdz6Zx1fqe9yLTs7KCS/MPTGP808 A+CXvhAvsp9iJATdVngWPUvZoNulCc9aHvSyulVjj1OmHe7ZcbuhdTOJGNlVtdt6Kx4S SEwJr4d7AvsRH4dRP6wpOaKlrF2U6LX1h14WebFiQZHJVHS8FrzZ+cju7jWF3AowXjmd oPig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=emwPYA8Z; 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 k68-v6si14266007pgk.294.2018.11.11.16.02.44; Sun, 11 Nov 2018 16:02:59 -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=emwPYA8Z; 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 S1732188AbeKLIRy (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:34452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732069AbeKLIRx (ORCPT ); Mon, 12 Nov 2018 03:17:53 -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 21AB7223AE; Sun, 11 Nov 2018 22:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975278; bh=3XJDbhAmvqHWEBCq/+5EOnSyZtbH6rTGAmNY3ja0aTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=emwPYA8Z99UHmGIIqMPXFF5n5OE2Fj/y97gIDrXn+ATzrRuCJpjUocizV4r40A47W 6WhyGacWmXs/s+8poQr7Lqfvy6JhMw7MAOVKg0jsfzi8xAgQPTfg9BQqW3CiQ6YoU/ hfrsStqob4iFHOBlh64E4Z5rkJwsrW5Y15JSlAnk= 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.19 192/361] Revert "f2fs: fix to clear PG_checked flag in set_page_dirty()" Date: Sun, 11 Nov 2018 14:18:59 -0800 Message-Id: <20181111221647.412384851@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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 @@ -2590,10 +2590,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)) { f2fs_register_inmem_page(inode, page);