Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2087342rwb; Fri, 12 Aug 2022 11:46:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR54fXL7Ted2Pb/Y3k5bxHzcWc9yyKGRXB7htMltUb8Ha6k8OrS/Yxml2rUmFzxT5OnM5aki X-Received: by 2002:a17:906:cc0d:b0:730:d6f3:277a with SMTP id ml13-20020a170906cc0d00b00730d6f3277amr3348579ejb.579.1660329989200; Fri, 12 Aug 2022 11:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660329989; cv=none; d=google.com; s=arc-20160816; b=aBw4gWrl0eKySe/dKtsPar4lPb/3pkJf3KOJr8OaKHwNXxGXJ3GxTkjP3rPTuB8K8i opG63HzJv/+qskH+kbhyUzMkkSghwKeYJT2RKuQ+ZO9J1uLTtmld8fVASktcPqY+EIst slo6smWyokYRmIIpqib18nfEuyr7PI1jg37JLFa/RyaSQCYVp/XolHI4KIedQjBhju+B KVhU0l6Tc1/EOeFlhDjA4xcARgYEwPdr2srnfrp1x5aLf60eQMM0QX3HXGhIOug/HtSB mRVWTTj9GH5L7WSBNOAyncihSzIYFdZiNinY8vByGJ96eswqYmYstu/n0fxS/rekH9cA zgvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=3BcBkg0yKvk84UKgHYlA5sMgVfRHt8ThTRnaQDZ4oU4=; b=txty8Di51gsmLJdpCsNAhSNLZLd6Q3tUIZ02WfkMFtDTS2yzfaec1vSZTgY7370aFc vCC8pkiZYN+IwkIATgiVJTMmjrRBF8EKS4T2b3yWeaxfowbhbBxHHgOf9iV4e9N4Jyw6 C+6PWi7kjso0iKLKfvH6d05TCdOMjXaI9Hl1CpH4KCsSEj1DDDBFf1JyBxoRtnTZqTEv 2Iyu5v0ycCEhgF0TPZ/W2/HFY8Tc7Ke9LIvHend/LdG7YcdSiQ75UjJSQnD/YBg2reoi A4EkdLu85VkC1+llxTNqF2SEeyX6AzR+TXWs7uhm/sdUF8Lgf+On6K8Q+3MDPg/MwgjO CK/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fi8kKktU; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a056402359400b0043c30afc919si3269247edc.438.2022.08.12.11.46.04; Fri, 12 Aug 2022 11:46: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=@kernel.org header.s=k20201202 header.b=Fi8kKktU; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238649AbiHLSml (ORCPT + 99 others); Fri, 12 Aug 2022 14:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbiHLSmk (ORCPT ); Fri, 12 Aug 2022 14:42:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1647AB274E; Fri, 12 Aug 2022 11:42:40 -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 A6FED61779; Fri, 12 Aug 2022 18:42:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52FD5C433D6; Fri, 12 Aug 2022 18:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660329759; bh=0SpTXliYw/kJ2X+cCNItoT93KPSfbEg24GS3DZyjttg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Fi8kKktUFO2l8KCGVfOlkMPBRgND1x8TPBbdD2gSLaQrI1BOchBVkiYPeQf+dWM9A ry0PxY8DO7Cy9XAoEXlDZK9btgUZe23bWHE08AVQtiCSJZyUztVstCRHy3dx1Qdxi7 3WIOVxokSzSu/U+aXbEs0jWW1zrSla1nWh/KIS0AyjDYU9h1pgY25BCPBf3m3/x14d xf2eKKBNAftmOxDq/M2SSl+Ny7A4hNp1dKGhTnNSOituf0KkVWllo7wTCVfE38wf4z 0UB/WwGUTSBCXoHATo34uARCQzbWYHgEyOO2fHGV9Z/7VqtIrKBK6pU/lbS4HwUEkh QTEaMHRF1mSgg== Message-ID: Subject: Re: [PATCH v3 1/3] ext4: don't increase iversion counter for ea_inodes From: Jeff Layton To: Lukas Czerner , linux-ext4@vger.kernel.org Cc: tytso@mit.edu, jack@suse.cz, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org, david@fromorbit.com Date: Fri, 12 Aug 2022 14:42:36 -0400 In-Reply-To: <20220812123727.46397-1-lczerner@redhat.com> References: <20220812123727.46397-1-lczerner@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.7 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,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 On Fri, 2022-08-12 at 14:37 +0200, Lukas Czerner wrote: > ea_inodes are using i_version for storing part of the reference count so > we really need to leave it alone. >=20 > 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(). >=20 > Signed-off-by: Lukas Czerner > Reviewed-by: Jan Kara > Reviewed-by: Jeff Layton > --- > v2, v3: no change >=20 > fs/ext4/inode.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > 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); > =20 > - 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); > =20 > /* the do_update_inode consumes one bh->b_count */ I've spent some time writing tests for the i_version counter (still quite rough right now), and what I've found is that this particular inode_inc_iversion results in the counter being bumped on _reads_ as well as writes, due to the atime changing. This call to inode_inc_iversion seems to make no sense, as we aren't bumping the mtime here. I'm still working on and testing this, but I think we'll probably just want to remove this inode_inc_iversion entirely, and leave the i_version bumping for normal files to happen when the timestamps are updated. So far, my testing seems to indicate that that does the right thing. Hopefully I'll have some testcases + patches for this next week sometime. Cheers, --=20 Jeff Layton