Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2651394imj; Mon, 11 Feb 2019 06:29:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYPpPHanQxCKt6/pMHgNvZKWfKyUaIABQ/Qyo1rcRW7Hqybi6ehbA/NoBIl2WVHfHwwZU5d X-Received: by 2002:a65:47ca:: with SMTP id f10mr34357957pgs.166.1549895380231; Mon, 11 Feb 2019 06:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895380; cv=none; d=google.com; s=arc-20160816; b=jyJWIXr2C14ETStQCFimMQSLU0FvvS9FksFHDcySK60yojdOcdQreFiWf5OK44v/Y5 7Blbf+BrbOWvlA6qXHPTpAsxFzlgr39NLAOXXUYZlRakTcxubRdKOaUihSIlw/se2Rpq 18Cel5eiy/EHVtip8Ype+6mWFKtTgH7Vucz9tInqOvNxdmujqhO9GL23wXjDQIezvTKO cDNhsbmvKOd217cHABvHAQQepDbP9FDYIjjPV9Td25dO8bUkUlLEOODBBT42fSvfX91A iPo+MtH3Wr9IYtBh9AEga0XNuqT8fk2YegxZZWfiy919j734HSiHtStJka89RFmrpsa0 D/8A== 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=VxeAInGwn4B94uYN9SgIuFblfCF+89howJ8XpPsJJ9E=; b=Iz1y+tuq2f/11e00v2ozohM1Qgm/zJZLwpg8lcrcIK2FDB81DIN/KJtMUKQCtvSbLT g/G7xuy5cEB3a47qoNRkvo/9cLbwf4nSFw7rd5rE9/BFR6+xFKNEan02S+MpPqrS12WF DQwIwdwKwDJF5N+3OkOOMMVXeV4s3IcbOgSQwSbYGY/SWVVk+iUXxaYJA1aIKWW4hQ1D pWhprlvXhnwvOiZuTI8MU5OIcWdqFeedrliBo0A5JSZS0baRlKNun7XFk68KPjwJnxtp MS/hXegAUrPdpuXan3/edGxuspLG9ULO8FnaITxRhkginicvverM6UT5gd1OX2zZa9FA pIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L/HwyVmG"; 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 o13si8056087pgv.433.2019.02.11.06.29.24; Mon, 11 Feb 2019 06:29:40 -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="L/HwyVmG"; 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 S1729463AbfBKOZ4 (ORCPT + 99 others); Mon, 11 Feb 2019 09:25:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:59544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729423AbfBKOZy (ORCPT ); Mon, 11 Feb 2019 09:25:54 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 DD5BB2075C; Mon, 11 Feb 2019 14:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895153; bh=kRoJyjY9n1d4Fu/ijxpfnhQKdEphitoxPMumEFqOpJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/HwyVmG/n/YLq3tyS29GnyO105wO5+w3xjjW2/qPiEbLbBoKl5Tkn2USWmAW7LaP Zug/7kRlPgDByS8p6UJ4qFEF/KAAnsMtMp5ym6C8YJb4dz1yFe5+tKo4RTGFKpIjDu whbbVHYeLwFNy8xWhUnLJANIXtOrqwku6K1+cG24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunlei He , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.20 080/352] f2fs: move dir data flush to write checkpoint process Date: Mon, 11 Feb 2019 15:15:07 +0100 Message-Id: <20190211141851.116413098@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b61ac5b720146c619c7cdf17eff2551b934399e5 ] This patch move dir data flush to write checkpoint process, by doing this, it may reduce some time for dir fsync. pre: -f2fs_do_sync_file enter -file_write_and_wait_range <- flush & wait -write_checkpoint -do_checkpoint <- wait all -f2fs_do_sync_file exit now: -f2fs_do_sync_file enter -write_checkpoint -block_operations <- flush dir & no wait -do_checkpoint <- wait all -f2fs_do_sync_file exit Signed-off-by: Yunlei He Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 88b124677189..9eaf07fd8b4c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -216,6 +216,9 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end, trace_f2fs_sync_file_enter(inode); + if (S_ISDIR(inode->i_mode)) + goto go_write; + /* if fdatasync is triggered, let's do in-place-update */ if (datasync || get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks) set_inode_flag(inode, FI_NEED_IPU); -- 2.19.1