From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 864CBC169C4 for ; Mon, 11 Feb 2019 16:08:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57B4221B18 for ; Mon, 11 Feb 2019 16:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549901310; bh=kRoJyjY9n1d4Fu/ijxpfnhQKdEphitoxPMumEFqOpJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QDSuacChJf6a4qt7ymTt5PFpwK1pGNS7peNYjkNcYj/9TKLI4h9jwP3GmM9xM6ldr sYONoDZzlLtGXKPR1z64q1RUZ2Np1qEAW5SK37rot1jJ5IW3g9aGWCaC/u1ZqN6ek6 fCdUae42DK1DIl+XW5J1u8vXYwrz78QlqsYEpmxo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729457AbfBKOZy (ORCPT ); Mon, 11 Feb 2019 09:25:54 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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