Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3760753pxt; Tue, 10 Aug 2021 10:41:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZSSPM3xxz/1W6rauudxnP8CbWaS9fEtthoRr59cor3AL7dcPTf48B/swum5ZXsP2GQ+lG X-Received: by 2002:a05:6402:35c7:: with SMTP id z7mr6174505edc.85.1628617288178; Tue, 10 Aug 2021 10:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617288; cv=none; d=google.com; s=arc-20160816; b=LPrJQNFOMpG5/Fs1XGsoH9UGJoQdNIy9pZXfc196Ui0IpP6dl5aMBMsa4EyQP4FYt3 Qm4pg2sivxPETVopa8pxYo/CtQ0l4OQR1TdlZVrXwsv+s37naRYD8G/OV3ExYmjp+q+K Oom8EnQp0KbLkpNqF4dFd2ephQAr3xxgP3H9efgqKnP1fHl8TeKL0CqkGXAm6VTYbMGG EeBYo0PwYOgXiTpP/uG0zf8zezeKhPhpT1lunMQQ4QYXeZ0PRvYZFaIQ4870momcpkrm eRuuOoEwIbnX9Ly+vRk6DIQle6vI9PkDTsqigLfDaWoMyvDcCaJMMQxdGp2mQBKjbr+D nEcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=azGqSv9gaBSbwut74x9v0U5XaNmU9uhystQDOeXcLcc=; b=iRRXYsHKfOEV2pWSzpkQIy24qFVVKINxL+AynfBzEdyTLxvGK6ukuvMVWrdvwv6dpz e3e+LSCfLPbNpCutyuaAuL03Bg6rpok7R/WikLpdG4pRpbZ1nrMB88QMfHs9zuE6+PXk bQls/DQHD5PRdRE0mrDB9lhPP21pX3BY4agsvxO2iGwbU4p7nOBKr+VNiOUDKVG0UBRU 4p+jvER5CiJdHcSpemHohacv5t2APpx9Q01V56Vhb1io/UoXspxISDZKUWNxO+dxEwKw WC1kupMU0pAqkAIifpmpmiENAjzKcMEoAqGZmyb5pbxGTOVCRhecz+CR7vIzNzvgvnYm +PFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dkQGTEfy; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si10111971edv.6.2021.08.10.10.41.04; Tue, 10 Aug 2021 10:41:28 -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=@linuxfoundation.org header.s=korg header.b=dkQGTEfy; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbhHJRjB (ORCPT + 99 others); Tue, 10 Aug 2021 13:39:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:39322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234105AbhHJRg3 (ORCPT ); Tue, 10 Aug 2021 13:36:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4462760F41; Tue, 10 Aug 2021 17:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616939; bh=/aGGnz2+Xn+ky93xkAtAVloyVlPvYKP+OQeSq01/cF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkQGTEfyrPsPhxaGv3VHr6BxPQXVLlalzE8ifvJngpLpfpmmNusk9FNo00GEOQ29N ZNx4ffU/I3iBljt+//AFUQ4B+S7ujbNdq9vMe1NKE1zLaX+yr+ZIwSdDG2auQqOXij J9W7Tp1YqS6Zb/ZOYeajiOQ+J9ddWrVOd9Z3lXgE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?=D0=91=D0=BB=D0=B0=D0=B3=D0=BE=D0=B4=D0=B0=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=20=D0=90=D1=80=D1=82=D1=91=D0=BC?= , Denis , Theodore Tso , stable@kernel.org Subject: [PATCH 5.4 60/85] ext4: fix potential htree corruption when growing large_dir directories Date: Tue, 10 Aug 2021 19:30:33 +0200 Message-Id: <20210810172950.267677587@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Theodore Ts'o commit 877ba3f729fd3d8ef0e29bc2a55e57cfa54b2e43 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- fs/ext4/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2407,7 +2407,7 @@ again: 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;