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=-10.1 required=3.0 tests=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 7616FC55191 for ; Fri, 24 Apr 2020 12:27:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D46D20700 for ; Fri, 24 Apr 2020 12:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587731233; bh=CA8zO5UpVMlcoGn02cPt+zMyeWdnhMr7Dns6RljCs1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bH7VBGBRpCVPMg5rUH3oAme5SkbOt7FCeHkN0R7i8CGAWoC6ZFUzRbrElpY/5R88S O5ZlvBOHgxVYUirHzYMJADHVu7mB3BTcCE9pNawy6fmbMSWOkncqG1ypb7sYtBGyAl tHFHuVNh28vg/Q1eITD/oo22JSj7fgs0id0BVqco= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727095AbgDXM1M (ORCPT ); Fri, 24 Apr 2020 08:27:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728479AbgDXMYi (ORCPT ); Fri, 24 Apr 2020 08:24:38 -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 D79302166E; Fri, 24 Apr 2020 12:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587731078; bh=CA8zO5UpVMlcoGn02cPt+zMyeWdnhMr7Dns6RljCs1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SvjyhXpta/HKRlJYvmPUgnyNpGU7R8mEMT8rI35EeKNa2Q7aHsJ0BZHviFY8s8iq5 KVtDaOe3KFB0s+98loJi9uEttbAxEsywbw8qyGfcMWPBaudUWO3VD/h+7MYTj38p3E gLH+WIgJ5qX8XG/8p0wTHmF/8NZJBv6VbVYq3L1s= 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.14 15/21] ext4: increase wait time needed before reuse of deleted inode numbers Date: Fri, 24 Apr 2020 08:24:13 -0400 Message-Id: <20200424122419.10648-15-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122419.10648-1-sashal@kernel.org> References: <20200424122419.10648-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Theodore Ts'o [ Upstream commit a17a9d935dc4a50acefaf319d58030f1da7f115a ] Current wait times have proven to be too short to protect against inode reuses that lead to metadata inconsistencies. Now that we will retry the inode allocation if we can't find any recently deleted inodes, it's a lot safer to increase the recently deleted time from 5 seconds to a minute. Link: https://lore.kernel.org/r/20200414023925.273867-1-tytso@mit.edu Google-Bug-Id: 36602237 Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 2a480c0ef1bc1..96efe53855a0b 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -673,7 +673,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent, * block has been written back to disk. (Yes, these values are * somewhat arbitrary...) */ -#define RECENTCY_MIN 5 +#define RECENTCY_MIN 60 #define RECENTCY_DIRTY 300 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino) -- 2.20.1