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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 02301C43463 for ; Fri, 18 Sep 2020 02:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5017235F8 for ; Fri, 18 Sep 2020 02:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600397321; bh=scP7xSiIf/2//q/2JgfsZd/MORBT9ZQs4LQcPZuYJcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UFvEzSfMCSiaJAmwNqrHDB47hwlNT08VIua11NUx+vxHTAaHQ2oDBzmyyB/Gi+EQV Ra4OFuwaPYe4f78b09O2GJr9DatRYX/X3rN8bhqQupm1qTlusq2lt4rPNLIMOHYdD1 hqX82e9kTwPufsCrw3kE9TtLyTzinHPnlhs8tXi8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729388AbgIRCsl (ORCPT ); Thu, 17 Sep 2020 22:48:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:60922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728252AbgIRCJM (ORCPT ); Thu, 17 Sep 2020 22:09:12 -0400 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 C16C32311A; Fri, 18 Sep 2020 02:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394952; bh=scP7xSiIf/2//q/2JgfsZd/MORBT9ZQs4LQcPZuYJcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1zJnPaiD7sTkuHd2Ctd5LdUWNYWucUDTC1xEeWza0DW56MUhZq2BT20eJ76gxJhus uW69d9L1G4dKd0s2nnMET4cgwtAvZBSSwMHTbd7CIObEgHYqDHQFNNIYD3pqr/QIpi s4dGVpJ/Rz32YBJIQScSuYMIQQkE0qYTgru4kw7A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Theodore Ts'o , Sasha Levin , linux-ext4@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 059/206] ext4: make dioread_nolock the default Date: Thu, 17 Sep 2020 22:05:35 -0400 Message-Id: <20200918020802.2065198-59-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020802.2065198-1-sashal@kernel.org> References: <20200918020802.2065198-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Theodore Ts'o [ Upstream commit 244adf6426ee31a83f397b700d964cff12a247d3 ] This fixes the direct I/O versus writeback race which can reveal stale data, and it improves the tail latency of commits on slow devices. Link: https://lore.kernel.org/r/20200125022254.1101588-1-tytso@mit.edu Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/super.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0c15ff19acbd4..0076ea7427e34 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1538,6 +1538,7 @@ static const match_table_t tokens = { {Opt_auto_da_alloc, "auto_da_alloc"}, {Opt_noauto_da_alloc, "noauto_da_alloc"}, {Opt_dioread_nolock, "dioread_nolock"}, + {Opt_dioread_lock, "nodioread_nolock"}, {Opt_dioread_lock, "dioread_lock"}, {Opt_discard, "discard"}, {Opt_nodiscard, "nodiscard"}, @@ -3712,6 +3713,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) set_opt(sb, NO_UID32); /* xattr user namespace & acls are now defaulted on */ set_opt(sb, XATTR_USER); + set_opt(sb, DIOREAD_NOLOCK); #ifdef CONFIG_EXT4_FS_POSIX_ACL set_opt(sb, POSIX_ACL); #endif @@ -3849,9 +3851,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount; if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { - printk_once(KERN_WARNING "EXT4-fs: Warning: mounting " - "with data=journal disables delayed " - "allocation and O_DIRECT support!\n"); + printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, and O_DIRECT support!\n"); + clear_opt(sb, DIOREAD_NOLOCK); if (test_opt2(sb, EXPLICIT_DELALLOC)) { ext4_msg(sb, KERN_ERR, "can't mount with " "both data=journal and delalloc"); -- 2.25.1