Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1161052imm; Wed, 1 Aug 2018 11:11:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpftlhvvZGfKLjd0+pUUclHYmmthVRnI2M5WIf8RfaoEebtiVnS1Qr0jxd48nlRnC4MKrQqR X-Received: by 2002:a17:902:4601:: with SMTP id o1-v6mr23747418pld.202.1533147084323; Wed, 01 Aug 2018 11:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533147084; cv=none; d=google.com; s=arc-20160816; b=AMMYKYuLTJGWD5U/ib/aVFxeUiJJG2a7jUKaPwdeeQi0xPANsX95m4J+pLjbPE842X w33CrVqinAy1BhbD4mgP9KDQ70r6f9m3Oz7oZ2C7tZyve2vAtYy0fUJvv/Iy1fwPlHKp UpNPzXJ2dpIXNQGhPb6crmxfY+e5NxVLscYMWfIeaG7DRBuJDgxfnbGQXiqFcwave7sh sijRx5tm0A1MnPEj+0j4nkMtBLNN2RvuqHfMKqflOIPA5JNb5XwkYXwwNgWSSBW7aCPm eziIkbsZk7O6/AagIvwPzhhFxM5sa4CFDZ446aQTog2e4hmqPthVY2BqVZXVxtxtj0g3 drVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dB4JzKMXZTJIuJ37S+exe3pmt3S8zZVYgLa0LcbB2ck=; b=XuVoFzxfnYuW6luM3iZL/EcEAHw9qga4BTVpdjQ/N4cV2q+ui3PgG6JbNbdZA1Y1Ck QnCqOsSGemRovsP4mk9YwPU9H/OndpEPvHZV/eqSrVbVvrYnaTpBG1PEe45YfJ45yBxt 1aA1Rzag0uJz5hhdSfb4zxz7aQaTuTenT6cDrpDFosBjx8dGoAeMmd7E/D/1IXU0s7CL 6Dim7LXZf7/Ia9wldE3Us5KzHTIL0ixQ3Gl+lyqkzMRnuslgwJsQUQYZBwxJQ6Jg6S5H NQQhIiB5qc0Rr1sWqIuiBezG5rs6WxFwrWocDXFyV5tDVlyiP5tSdIQI8xFZNQvJbkcR UuLw== 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 l18-v6si16558508pgg.152.2018.08.01.11.11.09; Wed, 01 Aug 2018 11:11:24 -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 S1732614AbeHAT5G (ORCPT + 99 others); Wed, 1 Aug 2018 15:57:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49812 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405750AbeHATIf (ORCPT ); Wed, 1 Aug 2018 15:08:35 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6D7BE1397; Wed, 1 Aug 2018 17:14:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Yunlei He , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.14 057/246] f2fs: fix to dont trigger writeback during recovery Date: Wed, 1 Aug 2018 18:49:27 +0200 Message-Id: <20180801165014.439877217@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Chao Yu [ Upstream commit 64c74a7ab505ea40d1b3e5d02735ecab08ae1b14 ] - f2fs_fill_super - recover_fsync_data - recover_data - del_fsync_inode - iput - iput_final - write_inode_now - f2fs_write_inode - f2fs_balance_fs - f2fs_balance_fs_bg - sync_dirty_inodes With data_flush mount option, during recovery, in order to avoid entering above writeback flow, let's detect recovery status and do skip in f2fs_balance_fs_bg. Signed-off-by: Chao Yu Signed-off-by: Yunlei He Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -435,6 +435,9 @@ void f2fs_balance_fs(struct f2fs_sb_info void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) { + if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) + return; + /* try to shrink extent cache when there is no enough memory */ if (!available_free_memory(sbi, EXTENT_CACHE)) f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER);