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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 9118EC4725A for ; Fri, 1 May 2020 13:54:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 614C92051A for ; Fri, 1 May 2020 13:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588341254; bh=CA8zO5UpVMlcoGn02cPt+zMyeWdnhMr7Dns6RljCs1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Te8IMYsaxt50tApNaZMXXREbIIlFkj2krJhESmhVbxp0rEcfT6eKCx0bGS/1gj7/L pKchFQ4Prga0fc6Hxfh4G2i/PjaVCdHkf5NcK8HGd8Niuz6/0x4ZCkwueRtHXCfbOx BA+Ui4dNq4rzhAR49bZ5n2qx2LDbJgb3fF3g0j98= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729702AbgEANfg (ORCPT ); Fri, 1 May 2020 09:35:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:33878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730727AbgEANfe (ORCPT ); Fri, 1 May 2020 09:35:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85E4724953; Fri, 1 May 2020 13:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588340134; bh=CA8zO5UpVMlcoGn02cPt+zMyeWdnhMr7Dns6RljCs1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHFH6ZVTV50/HuGFGQiNRA1vjoTWtrCox68RslKSXmnj0fl3+/cv2fH44PL6iCj/w zLSa6SkXozm49HQl9pE+asWiECP9unyap2864Wujme7onZnmqmhg1kg9dN5cIohNDD y1h5JF7sm/9UNsZugd4CTtWR1nY1AY/9SjcJ8ZSQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , Sasha Levin Subject: [PATCH 4.14 107/117] ext4: increase wait time needed before reuse of deleted inode numbers Date: Fri, 1 May 2020 15:22:23 +0200 Message-Id: <20200501131558.018681086@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131544.291247695@linuxfoundation.org> References: <20200501131544.291247695@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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