Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2681429imj; Mon, 11 Feb 2019 06:58:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IZEftJTYddQUyI7DQGa8pKA/AblhWiJDm6Fas16N39g5hoqcvrxK/0AH+6HybbuKeWIX6I6 X-Received: by 2002:a17:902:166:: with SMTP id 93mr37948673plb.20.1549897103182; Mon, 11 Feb 2019 06:58:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897103; cv=none; d=google.com; s=arc-20160816; b=Oi0Au6TKyk2WaN220BRolH+ArHLkkIdVDKfxCYgP+JghJJnbyuZYud2dJKsTKhA21s +qlGTP/wJ6YJaGHNociemW1TRqDjdzhbJXsoNNsjHhIhf4xc8kZgWDuz6BJBFh6KBOy+ WzQ8Bd+ZwJEY6+ptMutjImsHf55qU+YXV2kuvb+h/r+c9eqQ8aYIIsDGJqBC6f5WiO+m pLcn6ETCN5dHlrIbF+ZdV8see/ZpqFvxglB1MEH+WziwYyeLktlr8WpS1e6LIR0chSdt yXIWzsCEMSkdIRHPGzR9VGe8Y5YinaVWwAhWYF0dfWXp1m4M73ndN6qoAyIHyBUHC5OQ duww== 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=pZ/8gemdiNqIHfHev7rmqal5wijWOlLJgu09YKztKx8=; b=rq6geOs2Vjb1uX1yrSKVtDn34Pk87tbtDeDR7YcUkYxUoevKq8Zgu+Wl9axbpwH0Tt rDBDMv8OIatez1fdhHb/pcmPJxjeOWkKOnJ6wvbW6eUfa8V3/hBHKjKxQciJlUyCxoUY Vxe6GZ2zsYjMRSBsjvZKpuUArmtzfCtUrFcZbC0+1QD0LLw1qLgvDW6IGChjM9uB+7Jn Ke1e6NCay4Ll+9pN3Vpggy2UCF3tZX9rYaT4hRfO0j1067P1Y4suteI9ZZ89blVjbP9j Jyal0K0oKPmOsOjDrWNyrtNVqmHsRKvCtSt8UD9+Wf7eljf6GMTKSKnU4FkuLWTnDbw8 CYHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xFLzZ3vN; 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 s5si10314777pfk.97.2019.02.11.06.58.06; Mon, 11 Feb 2019 06:58:23 -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=xFLzZ3vN; 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 S2389069AbfBKOzz (ORCPT + 99 others); Mon, 11 Feb 2019 09:55:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:43022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388675AbfBKOzy (ORCPT ); Mon, 11 Feb 2019 09:55: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 160BC2229E; Mon, 11 Feb 2019 14:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896953; bh=mARF47O0D5nVTxYJxxD7HT11uHV1Eiq11l3r3ptlChA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xFLzZ3vNo9BHAUd1qTerx+NVfHxnbriz5mfg83th1UFoCnDE7MBKIK7h6NhTeY4y/ q1ExK+wTgBucXNh2EjJnBsQ1Jxy8WOfcWorUsA6zEZ82eQCaS+NhAa5wwRQKaXddUZ oBNMOclirbC0rllARzdPs3hNg8M3Vit8kArEoVxA= 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.14 042/205] f2fs: move dir data flush to write checkpoint process Date: Mon, 11 Feb 2019 15:17:20 +0100 Message-Id: <20190211141831.046406364@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 7d3189f1941c..5f549bc4e097 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -205,6 +205,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