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=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 D9936C43465 for ; Fri, 18 Sep 2020 03:08:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83788206DB for ; Fri, 18 Sep 2020 03:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600398530; bh=siNmCF0S5qqvQt+t7KK/xo8ewwCEw45lmuUYbpGz3rw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dBudrvaBaxinWngVGBWVPZ+7DuPiWqJtQO/EmkUE3E54kL++Bsgl9nV3Kgu/sUq1p Arag4U4Stdl0sLlpiCJAtH8VvqOiYvOWxLTAnVn9qx5fDM0rZ0Z9KMKsNAs65Deh/I jcsNeJUacyRmnRgO7Qb+ZVw/CHHkfNwHWF7poCtY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbgIRCDS (ORCPT ); Thu, 17 Sep 2020 22:03:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:49376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbgIRCDS (ORCPT ); Thu, 17 Sep 2020 22:03:18 -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 25AC723119; Fri, 18 Sep 2020 02:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394597; bh=siNmCF0S5qqvQt+t7KK/xo8ewwCEw45lmuUYbpGz3rw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scNIqh2LE63mdGPFGadbtwkVH+JdfiP5t9bgl2bt9uTWe/yGCmU5+aQWJfJ3xFZFk CvgraBOm3xoVxhGYdKl6dPoXS5A4mc9eJPeL5ISrkKCbR7saBSdNwXuC66Med8w+TM Ju0lZwWghNf1YN+OP1z11WORFzJwSM+sFtaHbejk= 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 5.4 105/330] ext4: make dioread_nolock the default Date: Thu, 17 Sep 2020 21:57:25 -0400 Message-Id: <20200918020110.2063155-105-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-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 4aae7e3e89a12..c32b8161ad3e9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1546,6 +1546,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"}, @@ -3750,6 +3751,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 @@ -3927,9 +3929,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) #endif 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