[nfsv4] Question about NFSv4 change attribute

Jeff Layton <jlayton@poochiereds.net> Mon, 15 August 2022 21:22 UTC

Return-Path: <jlayton@poochiereds.net>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9B900C1524DF for <nfsv4@ietfa.amsl.com>; Mon, 15 Aug 2022 14:22:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=poochiereds-net.20210112.gappssmtp.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P1lfTBxs3kwi for <nfsv4@ietfa.amsl.com>; Mon, 15 Aug 2022 14:22:06 -0700 (PDT)
Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 866F4C14F75F for <nfsv4@ietf.org>; Mon, 15 Aug 2022 14:22:06 -0700 (PDT)
Received: by mail-qv1-xf34.google.com with SMTP id d1so6363799qvs.0 for <nfsv4@ietf.org>; Mon, 15 Aug 2022 14:22:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:from:to:cc; bh=KEoh0N2UHPJvuJcL9IzkV7D+m0RYv4b2rOv3NYJnA/E=; b=ezbUEjPWyLRaeC6yo1spOmf7J9QUiZkjpweIasgQZWJ7RhSZpcfhsgDkO4uPHDxQEe LBdRoY1PPQMXAaYMXRzHhWRkHZAesny7QwqNwb2F/GtNpnVnkt9+wjUll3qpwyORxydg F8w80NVDXSpmc0XA/W2P5UXaNnE82zaZJ/dT0T+Jn3XhSspaWKG5i5h9vXELQGMsjIIO 22M7uGhJL/xXm2KPvBvK13p6K1kWLIQHCTKF4UGC+N1FgAI8SBXF3+D/ulNOLlzLTQVW yTZ6I46w+NRFU7mwHhInnund9fEzzZJX5Wt5mGxe7HZ+th/gJcWEpZ+wpcWhI6ZEvXoC lplA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:date:to:from :subject:message-id:x-gm-message-state:from:to:cc; bh=KEoh0N2UHPJvuJcL9IzkV7D+m0RYv4b2rOv3NYJnA/E=; b=1XBxnaFhoYdpaVGT/i/9B4xltUO+Z6tS7SW4O5ho6DFFWAVe/iToMBc42NelRdtGkt Teyudn+sNQxKXok0QaV97YKme9UuyIqul5VUZXhAavy1pvfbz1b2466G/xB9oiXCdsaq CU6ssLlGEg54pOWdWTy++IbYfnlFRWLo8pECWwh4JCiiY5mRU3CzTj8OWiSrJcQL06u9 VkaAJAtguq9srK0Nph84bELApXQo1U1KUtrfs+7moiFM9pDWNynQ8r4o5twrzcntYFUi HABx+G4Z0EkkJjzoFFIp4/OSxmmQGsu6Zca3lXWOUhE4mXfLy/3Zjb4EsMxd2KGjx1xR KmMg==
X-Gm-Message-State: ACgBeo1R1dumJh3nKs4HsTqRoFz8Iam4wxwl7NT/pprzhLFS97G9jMzq sXAS2jElelnApw9TSP8VTfG+Z4AW/jICOg==
X-Google-Smtp-Source: AA6agR6WN5QRqwFYawTbiIAuCai19sf2BZwyfllENlafX6GbkrZ0HXFCW5PJgmLLtzT29vBygUBHKA==
X-Received: by 2002:a05:6214:1bc8:b0:476:64bd:9351 with SMTP id m8-20020a0562141bc800b0047664bd9351mr14944935qvc.63.1660598524233; Mon, 15 Aug 2022 14:22:04 -0700 (PDT)
Received: from [192.168.1.3] (68-20-15-154.lightspeed.rlghnc.sbcglobal.net. [68.20.15.154]) by smtp.gmail.com with ESMTPSA id h4-20020a05620a244400b006b5a12eb838sm5060700qkn.31.2022.08.15.14.22.03 for <nfsv4@ietf.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 14:22:03 -0700 (PDT)
Message-ID: <9dcd5b2e78c91695bf14c05d743a4a95ffbde3d1.camel@poochiereds.net>
From: Jeff Layton <jlayton@poochiereds.net>
To: NFSv4 <nfsv4@ietf.org>
Date: Mon, 15 Aug 2022 17:22:02 -0400
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
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/yrRBMrVwWWDCrgHPAzq_yAEc7BU>
Subject: [nfsv4] Question about NFSv4 change attribute
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Aug 2022 21:22:07 -0000

tl;dr: if the POSIX atime (and only the atime) is updated due to a read,
do we need to update the change attribute?

Longer question...

I've been doing some work around the i_version counter in the Linux
kernel, which is used to implement the change attribute for NFSv4 for
some filesystems. What I've found is that there is some inconsistency in
the behavior between different exportable filesystems. In particular
btrfs does not bump the change attribute for atime-only updates, but
ext4 and xfs currently do.

The spec basically says "the value must change whenever the file data or
metadata changes". While an atime update is technically a metadata
change, it's not a "real" change to the inode. Changing it generally
causes cache invalidations, which we don't want to incur just because
someone did a read.

I think we probably ought to avoid incrementing the change attr when
only the atime is being changed. Am I wrong? What do other server
implementors do?

It might be nice to add an addendum to the spec that spells this out
either way.

Thanks,
-- 
Jeff Layton <jlayton@poochiereds.net>