Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp563696ybz; Fri, 24 Apr 2020 05:30:56 -0700 (PDT) X-Google-Smtp-Source: APiQypIv1xlXU0LKs+rDeQogboDTddgl+b5y8yWCjb//Jj0pW8ZbYJzx8WPLyvH1JqMGLOMMYYmW X-Received: by 2002:aa7:dc48:: with SMTP id g8mr7068228edu.33.1587731456496; Fri, 24 Apr 2020 05:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731456; cv=none; d=google.com; s=arc-20160816; b=FjhYaO3SpmVHvjJV3/n6tK+1z3FfRd/Ybl+upyTBDFSjiR4N1+Eq6e+RI3hOZCqrvS RZPwQRiQyXG033x1CMiHjmWmWREu5mZmS9vbboyo+z1pTvTZ1JqV1j4ZhOfsWXyhrZ98 YkDwaIdle95wsQy1b6I24PtkHdP/cUZBG9bGf56gUp/DUC3w2vh0ju2viRJ9ufjpy/wc rraCZQ3Mj+gbgLSw/Til7QoQi5YQPhmpyYG7a6Q7W7e0R0SuDeffX9xSONo4OGTlHpzp lpzljLk1NlErUhEvCuPjkp2mmNo2+b2h21qqXiVxa5xqmPpRIRsWvux3WTuyo3+eM7XH VcFw== 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=K4AoYtKMM2g+g40eppEIQC8UiEOeBaQgGeVbgGmj8xo=; b=MlV32Yq2XCFyZ2949KSJldDbOKon/UY1oXQNvrjY1qz04DnRATFeoW0KSDnpY4++9O WED3fY4uRpGKQGmx9emqMD10LUs7WOf2vzZ1X/3ukkIXPGTJQgRlqN1Q5YPB8+fN2BwP PtjhmR1bfpe2xOXIHZ8LKajXoJEneJsGSgVuSF8mGfDbKq6wf67jBIHsF20f5Alj7wVC Ta6fWRUuBz912NZHpFI8iyGJU8gC4B6aP+Q8tPKBxzu6mEyZse7tcUJiTDGJGEcbChTW YSlSDjDWFjh6sLCmpBETA+rjR626dO6zb06iWaM+dC3orb+dbZm9l4UOcBQjRy9SCGgU ZZTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QK+EMd5v; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 r15si2801055edx.362.2020.04.24.05.30.32; Fri, 24 Apr 2020 05:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=QK+EMd5v; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 S1728177AbgDXMXw (ORCPT + 99 others); Fri, 24 Apr 2020 08:23:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:53994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728172AbgDXMXu (ORCPT ); Fri, 24 Apr 2020 08:23:50 -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 E106B2087E; Fri, 24 Apr 2020 12:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587731030; bh=d9WCOVPH7L+/dPvkYP6Uk/9VEzZL2uz/ct95MRypraM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QK+EMd5vPKqzzg20lb+tT6HP9W8+6+NxVWOxe+b04hdfU6Mu4GC7WiCMJ1rgfZd2B YWWiMYO/uFZfR9XYDAqnzEiBDi7bpGG1rwMNW2FnOcVeZCiHYbBhKwvm2dep3pRiRG 6x8HI6Sd72zOTOrGPShttSaKOtwcSMz+b8VRRQX8= 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 23/26] ext4: increase wait time needed before reuse of deleted inode numbers Date: Fri, 24 Apr 2020 08:23:20 -0400 Message-Id: <20200424122323.10194-23-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122323.10194-1-sashal@kernel.org> References: <20200424122323.10194-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@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 a6288730210e8..64b6549dd9016 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -660,7 +660,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