Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp841596pxu; Mon, 23 Nov 2020 05:39:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq2UeixCYabWwlCZMj+NL4/sRrVTVxTErNoAt9MhaIC7kyD4knFG0geS81StonrZQkf6GN X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr42465210ejr.340.1606138750973; Mon, 23 Nov 2020 05:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138750; cv=none; d=google.com; s=arc-20160816; b=wG/hojs8ryzyq7ZmbI+wSsRPwJdeaUuxjTTMobLX284O7t73Bo5x+tOuCCma3Z4Pw1 1SpPUZ3t7nPLlMVE5qPMjNwP9zO96O2cDI0dqIs8dkMDRr6j2HRfZSz0WfS6COY2cP8J 6YlMT6GtOttVu+X0CZEMBYoLwpcqQoiIOBdHU2YrkfLbZBWoC18tIHBHWSxoKU+ACq9E NLrWb0TSaOuMZ74G1klIa1J7N5rQA7M9Q1aXgZaoYARh2IvTovnP6Dh8t71JJt15akn2 vjrOBWlxpuCgS8aHMJr/K+Zdgf0UVpoFFd9Tb1YuRMFaSO+NJ4EzQOU+Ty9eAAkjHDzL uwEQ== 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=DbrTMaOg98DkLLW2NrdQ3vtYtPfDG9Ka4WbIFM8MvgQ=; b=jaRswjfQSJr43k3vLL7Y1dewOd1XCsi2zWPjyM15F+5NgPjtN+NkBnN5KqexxVES2s 9hOlo85V1Fdt5cP0AuQ7rZlYg0suhLSbp9ow+ebDvWJL1CI6w80iOAQDbgHxxCHujJ8J PO/GJFo8rwXlO9D5LxTXJNW+pyFZmfCx/z8O4ZH4XOCQ8a7Mps8gD8eqHFeMpIBtXBdo BskXx8tYJ7oExIFd4n8AZL/XN4Hqiqsxhu/Gy9ZQGYvR/07fbPmYpNsyp31nyyXpIIjL 31eKtm5IS/HJs5M0gmAQB716gWTF6qWsaxDAr1GvzgKMG7ZxQcwnZ3uIxW+n/+kYKu5K n7Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RpPJr+gt; 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 i7si6474207ejc.568.2020.11.23.05.38.47; Mon, 23 Nov 2020 05:39:10 -0800 (PST) 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=RpPJr+gt; 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 S1729660AbgKWMXo (ORCPT + 99 others); Mon, 23 Nov 2020 07:23:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:32952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729628AbgKWMXk (ORCPT ); Mon, 23 Nov 2020 07:23:40 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 5D33120857; Mon, 23 Nov 2020 12:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134219; bh=iqiHMlR2S1EFbJRUZaP36wX4GW42lVUWnTxZEYCJkgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpPJr+gt446UdL+aeXXqIyw8DsCV0Ku84GQfkP25a+ZBpF9qo5/yXgnIqWss9M3vd c85DnJ7eYaX8PQaVfRsbj5A/kDqHMeYAlZoVBkqIE3tte/YeNF+HdxzXnYk0OQmTzh IxZ8Rr/zUA+Y2kstG1Ikv21b92QMnc+wvT6mwsFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Eric Biggers , Jan Kara , Theodore Tso , stable@kernel.org Subject: [PATCH 4.4 31/38] ext4: fix bogus warning in ext4_update_dx_flag() Date: Mon, 23 Nov 2020 13:22:17 +0100 Message-Id: <20201123121805.783585418@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121804.306030358@linuxfoundation.org> References: <20201123121804.306030358@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: Jan Kara commit f902b216501094495ff75834035656e8119c537f upstream. The idea of the warning in ext4_update_dx_flag() is that we should warn when we are clearing EXT4_INODE_INDEX on a filesystem with metadata checksums enabled since after clearing the flag, checksums for internal htree nodes will become invalid. So there's no need to warn (or actually do anything) when EXT4_INODE_INDEX is not set. Link: https://lore.kernel.org/r/20201118153032.17281-1-jack@suse.cz Fixes: 48a34311953d ("ext4: fix checksum errors with indexed dirs") Reported-by: Eric Biggers Reviewed-by: Eric Biggers Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/ext4.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2398,7 +2398,8 @@ int ext4_insert_dentry(struct inode *dir struct ext4_filename *fname); static inline void ext4_update_dx_flag(struct inode *inode) { - if (!ext4_has_feature_dir_index(inode->i_sb)) { + if (!ext4_has_feature_dir_index(inode->i_sb) && + ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) { /* ext4_iget() should have caught this... */ WARN_ON_ONCE(ext4_has_feature_metadata_csum(inode->i_sb)); ext4_clear_inode_flag(inode, EXT4_INODE_INDEX);