From mboxrd@z Thu Jan 1 00:00:00 1970 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 78020C04A68 for ; Thu, 28 Jul 2022 13:39:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbiG1Njb (ORCPT ); Thu, 28 Jul 2022 09:39:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiG1Nj1 (ORCPT ); Thu, 28 Jul 2022 09:39:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9AF7B56B86 for ; Thu, 28 Jul 2022 06:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659015564; 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=GVQ3ZezP1/B0tdTBxI24e5AMj6fd4rpJNzEsuIPhXYE=; b=cuWzVEnFjGvb45vYNL24j21q6/7BOo5dVJxcj/LtUVJrLF206Y3u+bNeUcQDFe1MZCtP2j BpbCUDp7iYR2+HRzdWAJ/KoC3Ydm2mG6r7RkAil0VWFRrAAODl7jq1elkdXCdMs1KgeoXc cIAxAQ/lo9jkQG3svGictSBF+USs7sk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-511-JHaJpZO3OW2Um10WV119OQ-1; Thu, 28 Jul 2022 09:39:16 -0400 X-MC-Unique: JHaJpZO3OW2Um10WV119OQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE62B181E070; Thu, 28 Jul 2022 13:39:15 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3FB02026D64; Thu, 28 Jul 2022 13:39:14 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: jlayton@kernel.org, tytso@mit.edu, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] ext4: don't increase iversion counter for ea_inodes Date: Thu, 28 Jul 2022 15:39:13 +0200 Message-Id: <20220728133914.49890-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 --- 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 84c0eb55071d..b76554124224 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5717,7 +5717,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.35.3