From patchwork Mon Oct 24 11:27:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp441789wru; Mon, 24 Oct 2022 06:06:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bSSMhk6k6fzwYucpjR178Wr5J3xe1nlkww70KUBp6uuADTCyW8o7iwBB3/WIU4YEKIz9p X-Received: by 2002:a17:90b:1d0e:b0:20d:a61f:84b1 with SMTP id on14-20020a17090b1d0e00b0020da61f84b1mr65354129pjb.172.1666616784770; Mon, 24 Oct 2022 06:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616784; cv=none; d=google.com; s=arc-20160816; b=nXAZ12HRQuVXkyMnZIsyZRf+evSg2Bery6vGTKjr4Wzse8IQcHjhXcRm9/gsBHswOH sEBmtYOLgLsW6lOIkyA1bBAS8mBAr/JozznBWTTJJFsPRfGwOVHyOKlCK7+G6ZT8FeoP dx2zCp7DC15Yg3ad1G+Naa6K5ewvSsT3r1iocUBxIHJp31YUaHt0O/nn214CbRuY/I0X qwqMUjRXfcdZ4Slbyeujq7qXDUq979XaWz32uIsXThn/4gBBp9UFRTknJMnodrPJh35R 5pziUhj84ORkkyVLu38WhL/53AjG1FBnxBxJr3fItr4jEQ8cIT4HjkyXEMPHpwp2Z4EZ 7oVA== 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=7TaXgPK0L3jbe3KnU4IlaPxAlLVw+cOSJOXGOBV/j7U=; b=YImVtiAMU6ODYmgTY+RhA0KXdJMIaRnCjBhy97Xu+6xamFJphp+qoSp94GwsYeOfjU 7CyKCFq0037bReT2OC7zLwlX4A3T/7XSez9UKtbrAblFVoVXdOIlZO+ymxmW+VGws1ul tyr+FHUZcuyd+wFwMm4aQmc7pMRC2S3nyYyth+HzG2+gdSKcr4iKESXaP88B4m6NVf+Y 8EjRqy7lsSd42BaZF8lMfYXKYGLZ1epXMe8J0sfS4Hp6yFgnAhbLtwztGkUkNYZDdY3Z h1t4SSplxcyo5MbahhNBHSmozgt2B/os01kahPFwDtVfhw/jgocXxyF+B4JpGjhfuv0v UF6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ys+h9LLB; 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 z5-20020a056a00240500b0053708adb535si36177984pfh.257.2022.10.24.06.06.01; Mon, 24 Oct 2022 06:06:24 -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=ys+h9LLB; 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 S235244AbiJXNFS (ORCPT + 99 others); Mon, 24 Oct 2022 09:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234950AbiJXNCS (ORCPT ); Mon, 24 Oct 2022 09:02:18 -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 701D72BE3D; Mon, 24 Oct 2022 05:19:56 -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 41A7461015; Mon, 24 Oct 2022 12:18:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56E83C433C1; Mon, 24 Oct 2022 12:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613918; bh=KF7sCAIdsozvMpIIucsXaQ/gNGcJr/ewwbxuXNv2Q88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ys+h9LLBapuE71RGENcQ8bYEPDUfWZx+uOncRBon6Rld7u36TBSBRTETx/Pd2vdSV cxIP2nIR+Pnh+qsls56jwGZX3DuFfr8nKGBpYM35/83ZuTrCvEyfv4Kvo8gUbnRXY2 eIB7GGcyyOJrBVZ4TrjnjBVE9CsuzaZR3LXALKNc= 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.10 064/390] ext4: dont increase iversion counter for ea_inodes Date: Mon, 24 Oct 2022 13:27:41 +0200 Message-Id: <20221024113025.347225145@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747574361338125165?= X-GMAIL-MSGID: =?utf-8?q?1747574361338125165?= 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 @@ -5769,7 +5769,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 */