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 7E82FC05027 for ; Wed, 1 Feb 2023 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232334AbjBAPzZ (ORCPT ); Wed, 1 Feb 2023 10:55:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbjBAPzJ (ORCPT ); Wed, 1 Feb 2023 10:55:09 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BEA97751C for ; Wed, 1 Feb 2023 07:54:33 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id dr8so31139543ejc.12 for ; Wed, 01 Feb 2023 07:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bXWqBgMOKv5SnbTsUMFlWPl1mxwCaGFXLbhg+69mJBo=; b=Sqps5nHkF4vfpjGc70sbUfCvx2Zc88TDnLNGyx0VmKmTxcv6JhSgWBbqee2E0+Q0KH yEM4HUxIchphwRzb5/SMvgThKH7jdGa7pafz04o1GUcvwGaMyejbgk4PWSeN+stZoGUm XTcTPqYBDzKAwpYXi5GPegLxK/7GH8Bf2kmv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bXWqBgMOKv5SnbTsUMFlWPl1mxwCaGFXLbhg+69mJBo=; b=oo+Qe1+6I3Nu9nA4hhxy+VdsqJGwTGm6r+bbELCMg/UkdkYz3FMbVB3C6723+aiB+z BtVETH2mkh922UxlB9MrmeIeF4xPm5IOKUgf7KW2ygiQ0BEClmjQipVIsWRylPbbjuBE k5QAxhFHX3TseyLTgtprE8GEf46Tk7q3h4Nw+uIaUUiIdzssErEekS2TUqI/AVg+vMgz OqInKVLl1CgFyvS6SN1LJRo4bZvi+t/1YqXq0l+usjLenSrsJ0XjDfQxQzguGWRiR8ok 5Vxiy5wTb9gedovYmOC2dXyS70vp6siuJLPt7d9v+AHI2w8mrQrjC28Dvj4ln+Q3mrOT bv6w== X-Gm-Message-State: AO0yUKXse01D/RM/UKZDOJjrqRoMa5NJeiY7qbIsgdJ+tQe0itMB+g3I pjN4Vpk+3QhjBOHnFGxAm376tQrEagZfPiS86LR7J2I5Hq4pKA== X-Google-Smtp-Source: AK7set8r8OoF7qrGxnNKdUpD+LKehxKmaT8vY+FzeL9YI2CliNZodxhhagWUKTRdSPk3WuV2thOqVJYqKrXrhfb22XI= X-Received: by 2002:a17:906:709:b0:88d:5c5d:6a6f with SMTP id y9-20020a170906070900b0088d5c5d6a6fmr855247ejb.236.1675266872159; Wed, 01 Feb 2023 07:54:32 -0800 (PST) MIME-Version: 1.0 References: <20221111093702.80975-1-zhangjiachen.jaycee@bytedance.com> In-Reply-To: From: Miklos Szeredi Date: Wed, 1 Feb 2023 16:54:21 +0100 Message-ID: Subject: Re: [PATCH] fuse: initialize attr_version of new fuse inodes by fc->attr_version To: Jiachen Zhang Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Nov 2022 at 09:52, Jiachen Zhang wrote: > > On Fri, Nov 11, 2022 at 5:37 PM Jiachen Zhang > wrote: > > > > The FUSE_READDIRPLUS request reply handler fuse_direntplus_link() might > > call fuse_iget() to initialize a new fuse_inode and change its attributes. > > But as the new fi->attr_version is always initialized with 0, even if the > > attr_version of the FUSE_READDIRPLUS request has become staled, staled attr > > may still be set to the new fuse_inode. This may cause file size > > inconsistency even when a filesystem backend is mounted with a single FUSE > > mountpoint. > > > > This commit fixes the issue by initializing new fuse_inode attr_versions by > > the global fc->attr_version. This may introduce more FUSE_GETATTR but can > > avoid weird attributes rollback being seen by users. > > > > Fixes: 19332138887c ("fuse: initialize attr_version of new fuse inodes by fc->attr_version") > > Ping..., and the Fixes tag should be: > > Fixes: fbee36b92abc ("fuse: fix uninitialized field in fuse_inode") Do you have a reproducer? Thanks, Miklos