From nobody Fri Oct 17 10:11:56 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51B35C4332F for ; Wed, 19 Oct 2022 08:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230325AbiJSIue (ORCPT ); Wed, 19 Oct 2022 04:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbiJSIsd (ORCPT ); Wed, 19 Oct 2022 04:48:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34F5900D9; Wed, 19 Oct 2022 01:46:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C84F617E9; Wed, 19 Oct 2022 08:44:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A690C433C1; Wed, 19 Oct 2022 08:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169046; bh=6BEkaoCyr1a3B8J21YBWZZrVNR7enMef3nl7AAJ8oEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVn8V0s2fN39fd0SbmScL7NpbXWg9uySJf5WOQXWFrFTQYR3AXIfgCnzyKP071DaG 9t+PfJbLN6XfnpvcV6elGhR7pZDo+JTz870EcNbvkR+rL+Y5wEU4xYZKIYxQCpNJAf fPH+FzeEJAHEMBr5EOJPhXUa434QEXozZ1bqCWrU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Lukas Czerner , Jan Kara , Jeff Layton , "Christian Brauner (Microsoft)" , Theodore Tso Subject: [PATCH 6.0 139/862] ext4: dont increase iversion counter for ea_inodes Date: Wed, 19 Oct 2022 10:23:46 +0200 Message-Id: <20221019083256.132228957@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Lukas Czerner commit 50f094a5580e6297bf10a807d16f0ee23fa576cf upstream. ea_inodes are using i_version for storing part of the reference count so we really need to leave it alone. The problem can be reproduced by xfstest ext4/026 when iversion is enabled. Fix it by not calling inode_inc_iversion() for EXT4_EA_INODE_FL inodes in ext4_mark_iloc_dirty(). Cc: stable@kernel.org Signed-off-by: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220824160349.39664-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5731,7 +5731,12 @@ int ext4_mark_iloc_dirty(handle_t *handl } ext4_fc_track_inode(handle, inode); =20 - if (IS_I_VERSION(inode)) + /* + * ea_inodes are using i_version for storing reference count, don't + * mess with it + */ + if (IS_I_VERSION(inode) && + !(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) inode_inc_iversion(inode); =20 /* the do_update_inode consumes one bh->b_count */