Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp793786rwe; Wed, 24 Aug 2022 09:04:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4vxeRWPZQsXGbXoI21yRMQdrZuTmqZRRmPb2on4zR48zfi9tP1ms9ob9UZWAmPIKgDogDF X-Received: by 2002:a17:902:9b97:b0:173:dd7:3f3 with SMTP id y23-20020a1709029b9700b001730dd703f3mr5467499plp.56.1661357069169; Wed, 24 Aug 2022 09:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661357069; cv=none; d=google.com; s=arc-20160816; b=R4CVe3fFmVMUq1YS42KSEn31PamJhFkabRO4XRAOMBpg8+jV0RryQ3VueydRKViOQb qiQUjyvXwOEzbi5ApcFKSOwqCUfLr+j0twCf+KYslPRafFJ7IYkQHb8DT/PLZhd8YbMB yu7AmEe1vIwSpdl5xEOGaXXKUFHobm2Me+z7q9z1o9misNsS68JR7R7ea3MVRHshim7l Fj78g0GPBSoa3EhTWHSbVIMS/ybudTVYlmbX+aV70SCdOeqTL+EXDaDRE0ZyWo9PrSq+ 7urms0CViqcL7GCtk5ApfncIgA54mYI74GjpcCixHJf2+VIDiCadfpLdHP0YF+e8Jxpm Q3gw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=R9TgYxQgeeSQI37o2tMlq+JF9pke5jeBPg+VbisKpTE=; b=vqsT4U2vlaU3z5XbhBR2ZIh1o9VNqdwODOGTx5V2R/pI5UmipeUyMXoajkQ/UCYEya TMCJDKpfgrOVj5aAjYM8Q1LkQzS2BpHW+0YT2sIdduI6IYM7eBfwpw80xmyif36+vCC4 zru8aV+WQWkISAPMReNYSyZnyNttsSW1w5oUciEb31Kw6OS0Pf0avaN2nzv0TEM/LgUz 4N9usATR3uMbRPzRX7ERRoAJNOL1yyuInOdLyrpRRyC4YglxNpNGq36IEDaPaw6xs5Wi f0Ii/3BO1bLNuondiM3hcJFw8fMiRdrwxsKG+zG5g1NnfjNYIS60QxAZK9w+S9JqqWtw NAjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=htKebKwN; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh9-20020a17090b4ac900b001f50bbcc59dsi1731597pjb.9.2022.08.24.09.04.06; Wed, 24 Aug 2022 09:04:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@redhat.com header.s=mimecast20190719 header.b=htKebKwN; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239173AbiHXQD7 (ORCPT + 99 others); Wed, 24 Aug 2022 12:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239156AbiHXQD5 (ORCPT ); Wed, 24 Aug 2022 12:03:57 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 799187CB7E for ; Wed, 24 Aug 2022 09:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661357035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R9TgYxQgeeSQI37o2tMlq+JF9pke5jeBPg+VbisKpTE=; b=htKebKwN0cThq1yeLYr7Ti4zJD5+Pn0q/AuANAb1TdpfK7CRtJZHo0oZzNpmyd6k44Uucj wpBu5VqIYU/Gtk8qsMy7FoU0M/wBLogMT+DiGDgXbTYWeoI6uvnGD+/VB93fITbl4zopRA TiLZgqPm0jdI6UF9knYudsplnFuMuiY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-O5e4MvMLOICHGnkk5xfhCg-1; Wed, 24 Aug 2022 12:03:52 -0400 X-MC-Unique: O5e4MvMLOICHGnkk5xfhCg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EC6DC1C13948; Wed, 24 Aug 2022 16:03:51 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81581492C3B; Wed, 24 Aug 2022 16:03:50 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, jlayton@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org, david@fromorbit.com, Christian Brauner Subject: [PATCH v4 1/3] ext4: don't increase iversion counter for ea_inodes Date: Wed, 24 Aug 2022 18:03:47 +0200 Message-Id: <20220824160349.39664-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org 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(). Signed-off-by: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Reviewed-by: Christian Brauner (Microsoft) --- v2, v3, v4: no change fs/ext4/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 601214453c3a..2a220be34caa 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5731,7 +5731,12 @@ int ext4_mark_iloc_dirty(handle_t *handle, } 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 */ -- 2.37.1