From patchwork Mon Oct 24 11:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp463451wru; Mon, 24 Oct 2022 06:48:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y+mHgqRQ7hL3jh8OfQWuIpvvNjV5wYVtc+BtFq/R5d2iY1ftxsMBA27uiJYvXjNK5w+g5 X-Received: by 2002:a50:d70a:0:b0:460:5db5:368b with SMTP id t10-20020a50d70a000000b004605db5368bmr21100849edi.397.1666619280344; Mon, 24 Oct 2022 06:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619280; cv=none; d=google.com; s=arc-20160816; b=fbF5vpVSdg5sAY8l902mrm+QH+6J2l+WNxF3fGk26a8ZFTV5upSvAbhPWMkenxmzfs g1pKfP//+bHK7SN8P/o0yGOYrKPzhfj/NdQuGrhfoJ5rzFjFcvyMxqs2YC0P6ykmNHkc /n5bCaHGWIVtvb1PXOOm8hjvUhQ/w+0nEgMErrMDD+gBM53VHZBQeEAdOUb0FORV9jyM ScjNGKrz93x4rshqkJ2nnfRzZq9z3fQlZB+tHrNhE23RHPN7l0vA8jr5Ps7gQdZ4vxJm eSJk33ERU6Zu8+/H/qQEpathmNWX3/8kf1UVtYXPT9fgQCiJ7yTcVTIpt4Vz64cPEHLi hLkQ== 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=UdnDAWhsJfMDdItabgoynwqIyFhX5AtJQIAUugXSGcM=; b=c0H0HIrY/ydWmlptB2NawQtOrCjUnSnUYDQjPHmCaVmbgnqfWDLEr7hWRlKWJGsc9Z 8xFKXukcS2z60H+R/VY8FrChWBMF6w0d8hnUaUtCyJr/LcXhf92ZEQN0bcKyoae8p2bn jV1Xc+bUhAaTq5anBL0GfF8YExg7HCfcXPwkWonf/Q64b3ekMAWul2ONgKiEqa02JUU/ qikkRNNoXzbyKKSf+BlLH+lzBSzs92Ge9Tds/ldPkp2n2CI8Mq70UF/cQmbgeTJzdvn+ ETnm9lnolzFF61MnNFyvq7vKq7nG7L3D8oESwJ6k73NR/bPtNqBXsVCPenvslEgQ3OXR GzWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=whDMkzeK; 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 i4-20020a170906698400b00783d969f318si24730447ejr.253.2022.10.24.06.47.35; Mon, 24 Oct 2022 06:48: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=whDMkzeK; 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 S236232AbiJXNnF (ORCPT + 99 others); Mon, 24 Oct 2022 09:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236684AbiJXNlE (ORCPT ); Mon, 24 Oct 2022 09:41:04 -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 8F5ABB3B04; Mon, 24 Oct 2022 05:38:08 -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 9088F61326; Mon, 24 Oct 2022 12:37:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A32E0C433D6; Mon, 24 Oct 2022 12:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615052; bh=rEC/jNmzP26VTMds8NVsPf5tqRzefsXbvPgDYAJAvbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=whDMkzeKVL6HHFYYSKCHYSndVsHNczgvj5ZqLBEqoaEmgI+Ogiy+pxB6FzB4xkrH4 kqhqrcOejkKwGhRGaUTfkqU7g8VyTP/ZBVjIIuYbflX0ASKmSl2zB4axqFKXgejOYV WpdyOmZsw1wjPLEI3qW/ZPt/n3JWpc8lP2+q5cq4= 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 5.15 096/530] ext4: dont increase iversion counter for ea_inodes Date: Mon, 24 Oct 2022 13:27:20 +0200 Message-Id: <20221024113049.362333658@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747576978329239983?= X-GMAIL-MSGID: =?utf-8?q?1747576978329239983?= 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 @@ -5701,7 +5701,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 */