From patchwork Wed Oct 19 08:23:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp205912wrs; Wed, 19 Oct 2022 01:51:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qxwFAdjOrO97Kt3CdSo5t+KOQwLXFmosph+WZj1NsqZRXQQMxC0D+Mh0Vjgxj6IbYuGKu X-Received: by 2002:a63:220a:0:b0:463:7c92:ef9d with SMTP id i10-20020a63220a000000b004637c92ef9dmr6306374pgi.42.1666169460081; Wed, 19 Oct 2022 01:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169460; cv=none; d=google.com; s=arc-20160816; b=TQUAIzau+un9RqC4G/FTD/tpOW238kp7MLs/8DhO4XK1P1B540WjMsiTqoXeAE42Cw i6ZmsO/jKYn54MW5PjL7SnxNBGpIFejuEteNk7G/fTD5JdISihTcPVhpJ/1tvpOweVSo q+Q34SWXZ5ozW7AfXWbZ2Rujwaa8X3TUN9IfJQHdZeSAiX0Z7H+VDbhp/XiwekogdZi3 QDa624qMMjqey38nZJMopJuPl769y4M4QYeScjFHJUhHliKuYlVn3O0LHxQlRQIg73WU qONCmjq7LHmeKOAs4PsNi6cdWwpa6bkolXLTpxYEqQrVGrXtZm1zLbCb/ls8y2VaAYse spAA== 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=R6uHFraa2OSjPf2EcUleJpx/5BXtLzWBU5RXifaJ0Gg=; b=GGRXNEgmgK2X8Ach046jd2Q3cEAsM5HL+DCLxRPTEJsvdLCb7n57yWlsgY4kwc7R53 UrHeDSCiWdbqEsa+/We+sLm53bVghPVb+0XfAaKCxDuZuMpFlC73E71TpEQbaMlM8e1x LblULTmzJGMFMGQgUYmtXfotqoSwPSM9l5z4qBVzDMxIS3mut68Fx6S95jRHEZ1wXYvc 8JilZmcpMUB9MEfM0B4Ac1LgO7xcr9pAeFqDC6zjzls0/fJdkj8t6eY9zDynkpDjkN97 9FJRM4IKxDIvXH4WYyjiSox+24VIjQt+rqD8PnhmgP60kVGrSEL4o7+BGmZ3WUtUfHIn dg5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVn8V0s2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020aa78f0b000000b00560f0fe840asi16687300pfr.157.2022.10.19.01.50.46; Wed, 19 Oct 2022 01:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVn8V0s2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230130AbiJSIuc (ORCPT + 99 others); Wed, 19 Oct 2022 04:50:32 -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 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747105307673502748?= X-GMAIL-MSGID: =?utf-8?q?1747105307673502748?= 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); - 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); /* the do_update_inode consumes one bh->b_count */