Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp231803ybb; Tue, 14 Apr 2020 23:50:23 -0700 (PDT) X-Google-Smtp-Source: APiQypI9FhXoTVsCSeO54/icUp3lTOTmOP3T+eRk/6OtkgES5ksvmj9IGKV0TmuSu1SEbaTRy4kO X-Received: by 2002:a50:f0dc:: with SMTP id a28mr9042122edm.87.1586933423657; Tue, 14 Apr 2020 23:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586933423; cv=none; d=google.com; s=arc-20160816; b=xjrG4DxMLeywVnr276J7YCrXMy1MHAcAeS5CEbJaftAO52QS12NV0GRAiL6hqwtCh7 ynUnipqpVqQDmIc7+IF2+kRr5zmavCrYr6s348j+heK/XT5BVby/uSbdXNtxElvG8E/8 eQaO+LjpFmYTaAWiVOINJiE1CpRLeksONuHXpzPDW8ekU4RUMbKZP3JRaDr6Yd2Y1Pap ITI2FzBXKnfLUyOLpHl7qaqj0kOWhJN5z3q1KMkmD/mE2WcSE2inr6lICo7GoXk9dW2i so2r3ablX4LyKen16XEBK8INWD2RAJyP5oks4wXQc5iNPJXBzPPIuQV5gGlmdWm3Y6xe kwqQ== 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 :message-id:date:subject:cc:to:from; bh=cD8xDaimXoXuEzxhH1Hcbj6rHggbqo1NfbTfy26LGSg=; b=CXTxxgWvWSqut/5E0gpvgOdx3mRN8vs5L0VyelXWoFc99vxhuCASx8oDbSXwouTlqk iNEeu9GOHYYxocGiB5kKFOksY3CAKy/ZlPM5Ox3qZD65T0+Dum/hshEsmLVCIgLfL/Qm tQXQgBrGDqFtJVwItcmoqF/1Pml0a4Pm8cm/7i5QgfXe4NuP/DkHnXxnXli0QU3B+WXG yzI3ai9HuSuRjlgDQCsRSHGvJVyqKQ1yBjizGFPo5YmzJVskdMhCAVx9QYZA+zVjGPaN 6WOILAop7jxEeOxrhVitZOQOy3DumT4ogNR9A66/SQbTJNnU7Zj74e66+ErdWIYb/lvG ldIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si9497316eds.302.2020.04.14.23.50.00; Tue, 14 Apr 2020 23:50:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404138AbgDNCjb (ORCPT + 99 others); Mon, 13 Apr 2020 22:39:31 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:47879 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404127AbgDNCja (ORCPT ); Mon, 13 Apr 2020 22:39:30 -0400 Received: from callcc.thunk.org (pool-72-93-95-157.bstnma.fios.verizon.net [72.93.95.157]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 03E2dRWo009889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Apr 2020 22:39:27 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 1B5CE42013D; Mon, 13 Apr 2020 22:39:27 -0400 (EDT) From: "Theodore Ts'o" To: Ext4 Developers List Cc: "Theodore Ts'o" Subject: [PATCH] ext4: increase wait time needed before reuse of deleted inode numbers Date: Mon, 13 Apr 2020 22:39:25 -0400 Message-Id: <20200414023925.273867-1-tytso@mit.edu> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. Google-Bug-Id: 36602237 Signed-off-by: Theodore Ts'o --- 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 9faaf32be5cc..4b8c9a9bdf0c 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -662,7 +662,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.24.1