Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp21343pxt; Wed, 4 Aug 2021 14:34:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyISBuhY5DZApskcUHHoqksEJMPvCma0GkfSbkubiGtvvDu8/Ap1XYm20TzKFXvAwa41ccr X-Received: by 2002:a05:6638:1928:: with SMTP id p40mr1406195jal.93.1628112866347; Wed, 04 Aug 2021 14:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628112866; cv=none; d=google.com; s=arc-20160816; b=taJjL9IRJZc7uIIgT3eCg752AlsJiDchBEPCEx8QIAkuLYORFtor+SKU7qOz8GbTiD t0/AfhrbJvPvJFcC1JQHqx4h02jNEUNgtKFGXZNhQ3lZQ7VV0UuvataioIur171dKctD ZFc8mfuJCP9US9B4O5RptW3/FIt69fA6NmyCEDrP4rydcfKiJSEzpm99PPyid3NGH3EK nnkyWiWslIqEj2+7DTPrDiPCI8lgGF9V5NYK/DL6Nx6nfEZX6d5AGvQ5NEKn0eQOxdr3 DDKSGT0j2gt+tNG4UVKbUOhTsS6uliQJE4+A4WWpstMXgvpkZsn417NK90JN2x8SDJwL yZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TdIqLOqXLrjEGVQn/No55OJFf0rxyjLjtWl/OiCGce8=; b=br8SXVsXjCQHd/4HeOXUPLWOeJn0vaFsStnn9KsShwwdotaznDQPh1cHPC6CfnLTy5 SqS+PD5genIL5I+Q/exhb8dhO96+G3aci5mrCAHUZvAJk2RZ9183GW5jprvbtP5CPebV 6GtuwesnP+F9Dsxgp1sJ6Q5ij1vy3FSl+fkfatdo1KRsw4s7Izss0IDCLYA+LC5jGREw yWXwDeowga2TAQnxFya1jIy0micWOlM9DZkEmxyEn/s08yaXuq8epayWmh4FcQC6fFcd XC8Gfp5Yqd9G6E83CaEnAZn5J0wVjJ4GPEzpLkLIGmrc5+TKeML4CRFzMl8V8sFEafaa /Z7g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si4220957iov.42.2021.08.04.14.33.40; Wed, 04 Aug 2021 14:34:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239149AbhHDTZi (ORCPT + 99 others); Wed, 4 Aug 2021 15:25:38 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:44449 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240715AbhHDTZf (ORCPT ); Wed, 4 Aug 2021 15:25:35 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 174JPD2X024562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Aug 2021 15:25:13 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 2297115C3DD2; Wed, 4 Aug 2021 15:25:13 -0400 (EDT) Date: Wed, 4 Aug 2021 15:25:13 -0400 From: "Theodore Ts'o" To: =?utf-8?B?0JHQu9Cw0LPQvtC00LDRgNC10L3QutC+INCQ0YDRgtGR0Lw=?= Cc: Carlos Carvalho , linux-ext4@vger.kernel.org, Theodore Tso , Andreas Dilger Subject: Re: bug with large_dir in 5.12.17 Message-ID: References: <5FE9762B-6C6B-4A44-AC99-22192B76C060@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5FE9762B-6C6B-4A44-AC99-22192B76C060@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jul 29, 2021 at 10:23:35PM +0300, Благодаренко Артём wrote: > Hello, > > It looks like the fix b5776e7524afbd4569978ff790864755c438bba7 "ext4: fix potential htree index checksum corruption” introduced this regression. > I reverted it and my test from previous message passed the dangerous level of 1570000 names count. > Now test is still in progress. 2520000 names are already created. > > I am searching the way to fix this. > > Best regards, > Artem Blagodarenko. Hi Artem, did you have a chance to take a look at some of the possible fixes which I floated on this thread? Do you have any objections if I take this and send it to Linus? Thanks, - Ted From fa8db30806b4e83981c65f18f98de33f804012d9 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 4 Aug 2021 14:23:55 -0400 Subject: [PATCH] ext4: fix potential htree correuption when growing large_dir directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit b5776e7524af ("ext4: fix potential htree index checksum corruption) removed a required restart when multiple levels of index nodes need to be split. Fix this to avoid directory htree corruptions when using the large_dir feature. Cc: stable@kernel.org # v5.11 Cc: Благодаренко Артём Fixes: b5776e7524af ("ext4: fix potential htree index checksum corruption) Reported-by: Denis Signed-off-by: Theodore Ts'o --- fs/ext4/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 5fd56f616cf0..f3bbcd4efb56 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2517,7 +2517,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname, goto journal_error; err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); - if (err) + if (restart || err) goto journal_error; } else { struct dx_root *dxroot; -- 2.31.0