Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3626127imu; Mon, 28 Jan 2019 08:04:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN55BzrCV7t7fiQD7eXzCMT1cuQX8w7GnfIRd3Mj5UyX9HNUq/Fj85Y8ojrucML+DjnXi7qu X-Received: by 2002:a17:902:b282:: with SMTP id u2mr22672030plr.89.1548691442942; Mon, 28 Jan 2019 08:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691442; cv=none; d=google.com; s=arc-20160816; b=VF8LH5Om7OdwqOlfg1fI1xqcjloHu04UicYRgkDKkNk+GXhH//UnP8ZK+g2ApyK6He pQ+iHlN3sk/Igdsj1vTSlh/hlsdQnfb0NMAwG/bDTo89EnmRnoLPUidxB+N41ctFXnEd /MDDtl1LDjFHjFCDZ0KEYMhXa/xqmdYGIxXABNH2T3MVgJ8ADSESPPKinb/WJWnx8/fg tpzOgAhro3uDCuXRVuFQm2bgy79YcRWwz83t1BBhO4TOArWHIU3Ui5kkhUUeoxpvaueA tEawmg2Kt8BmPxD5oXG0r7ebG0Av6jvlEJzhsphyT0tp4Eu1zDo7c0hpI3wqcmONeCmO S3PQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ioh17vMdeztG+Y4Ge7ccjv+OG4gc0M+FDD4xjAsRdn8=; b=eKkihY0Yj/PmE6lJb+UBzTMhKj1JtfbO2XDvKtW9bWjZPZVEfUFZMBL2+gEu1nAaOs Wt3Iix6YQWEaHTO+mpMGDYJNc4L5TuNj8HOYpQGJFGcWuN7T4Tf4S/MkX/7w6iS33396 QsmrYOFAjZhacfWdQWZxyI0QJDcryfhbk/gTDImttMzD9QlfF6Wz3dpfSc4P2hF4QEGe n6Jnmw/avD9V98SboW+9VOc6aEY9YXemZW89rNhk57BvwvHY5NDtYPtusyyucbzhrilA 3O1SCWglLAHxvbidl2lf/TTx2dpBY9T+egEqxUog7CrHUekzHb4C3SKgXKUpr5K5vpjY kKlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j4DLQ/bQ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si32925330pfh.96.2019.01.28.08.03.46; Mon, 28 Jan 2019 08:04:02 -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="j4DLQ/bQ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731303AbfA1QDB (ORCPT + 99 others); Mon, 28 Jan 2019 11:03:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:48278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730204AbfA1QC6 (ORCPT ); Mon, 28 Jan 2019 11:02:58 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 478B221916; Mon, 28 Jan 2019 16:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691378; bh=SL6m3v8iLDqOl1PzDnj68tS6ASdfPaiTY2prpZ1jl9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4DLQ/bQRUt3vDMLXU1dCdmemFQl4wMd30jgtjTUQiDXUJDg6aKNtOmaBMFjgZrh5 bGfMiP0A5fjaaOg61IRNFMASj9Ge7Qm7HsgBJswG2fooo+XeHx8g/v/qbStMPXTEly JoTaF3Xv75x7/bJT511UcEKRIzBao8l+A8htIZM0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yunlei He , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 4.19 072/258] f2fs: move dir data flush to write checkpoint process Date: Mon, 28 Jan 2019 10:56:18 -0500 Message-Id: <20190128155924.51521-72-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunlei He [ 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 5474aaa274b9..fd36aa6569dc 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -220,6 +220,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