Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp559018ybz; Fri, 24 Apr 2020 05:25:36 -0700 (PDT) X-Google-Smtp-Source: APiQypIj/2cnSt7EpRsPs7tTjXLVd0QmJpNGaWm2PUmgDKtSmfirg33pe4e9FTQTbI4RxswIVgLi X-Received: by 2002:a17:907:6fc:: with SMTP id yh28mr7223252ejb.326.1587731136328; Fri, 24 Apr 2020 05:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731136; cv=none; d=google.com; s=arc-20160816; b=D0szl4obDSTfA55KOVOj51hmce9dkQDOSB9ZTETR2dmHfbJHkx33iIvqbhs0j6vr0k pLSnwzmyTXRK0dnhpFsAWqYDzvtccVZt8xYQBRUQ6iLEMXqsfSmv8HgMfUs8E5LLown2 Ies3eT8aHe06nywyGeLM8/fW5E/xeB7PjK9Y0M4sTlRR+FjBGKVzZVJev7xugLU1a+Ka PM2LK2QuXbWBFXBg4Jkn3g6NJRIhWplZUCVcWiTD2S94Xt2Om9T/ge1iKzXCynzDDTzk 3fgatXBGIMzLXo/rYbixhkQWzx5YOly/fcRSR51YglvyN5XIon3WaEVg0Hp2bzuQ/w0F U0dQ== 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=VlQk/d+GHLR21MFqkFMqlkOMlQG8X5g/DheicpYFeHo=; b=i5C2fXs5WERIPbxVGUXWoSdDfnNEA7VNST50rF88/hCWWr+CAHe4wYr9QcHt1ydYwG zAj5hTHw/cm3/EcjS+tOnBkXrZZa9pEO1nYU98Qb/nDN91S1K23zQhnlZgzSbHjTyrqO HTtP1fF4jZFcV8F76LKdBAUzH138JUaWVMHE1kxXAf/QcmPoT2JEQKJRWww6hd7EdJVv CDJPR57jZUB48VNL9VxG71XWRwryYjekKzOg+szhuEnEPMk3/R9lJD7vnQKL+/8JOSii 1/reHUTWmEPelXj4WrqkoFqXr+LkzlUIj0gNPxV02f9jW35HoZGmGDHZlFjIyNHpJy1x qdcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bun2ZAll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o6si2965336ejb.97.2020.04.24.05.25.11; Fri, 24 Apr 2020 05:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bun2ZAll; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727955AbgDXMXW (ORCPT + 99 others); Fri, 24 Apr 2020 08:23:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbgDXMXQ (ORCPT ); Fri, 24 Apr 2020 08:23:16 -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 11D2A2087E; Fri, 24 Apr 2020 12:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730995; bh=edshClquLjQLAskTiibmYotWxRfjfhE2CQvBtrwoN0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bun2ZAllrkmGXY6VnX9g67+lqG4qT3nmmXccD/knnzno/pXS2IMfs7vYpM7xfIfw+ kmERc014bgEq4Mbxm12Kh2AnYIuTQSNi0NiVPuvxYon8EYxM8+cNAImxSwCicvOJgV 6pxNiACINBXJxji3HNglurZAoO1JnQ+1GhUv8mrI= 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.6 33/38] ext4: increase wait time needed before reuse of deleted inode numbers Date: Fri, 24 Apr 2020 08:22:31 -0400 Message-Id: <20200424122237.9831-33-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122237.9831-1-sashal@kernel.org> References: <20200424122237.9831-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review 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: 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 f95ee99091e4c..eab18b7b56e77 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -663,7 +663,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