[nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operations
Pali Rohár <pali-ietf-nfsv4@ietf.pali.im> Fri, 09 August 2024 09:00 UTC
Return-Path: <pali-ietf-nfsv4@ietf.pali.im>
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 37590C1840C7 for <nfsv4@ietfa.amsl.com>; Fri, 9 Aug 2024 02:00:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.006
X-Spam-Level:
X-Spam-Status: No, score=-2.006 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pali.im
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 I3uTBg6IBJlG for <nfsv4@ietfa.amsl.com>; Fri, 9 Aug 2024 02:00:13 -0700 (PDT)
Received: from pali.im (mail.pali.im [IPv6:2a02:2b88:6:5cc6::2a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 99615C180B77 for <nfsv4@ietf.org>; Fri, 9 Aug 2024 02:00:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pali.im; s=mail; t=1723194008; i=@pali.im; bh=0PAcwKHIbsvsT7TcZFhuX7ZQFT9tkmRJDx6BRaUBS10=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Eq2OjGJY3HB5LwPGbhYIgMo4tfsu+pysjY+tRETCpb+KvWT4mF9eNF1g3cKNukgtl WeYaqIE3/5Zgd8NjenbQd7H0Q401A0uvuDVKwMI6FTdLfUWWwqAHHoQ/+ehGiNkgqi IwtHdBAWhyOQbCiWFC4G4nss/gsW+kQgyof8jyWHnIo4ljRtwwF2dZOGs3C26UUOm0 oon/pziZyIGlYqhP94lBPpD2TEYKpsElfmU2CESrzOvtGuMwT1Hvg/mbW2kg+8rXxa lg0YcLZBrq4vG4F+kT64N1A6GqTGRpP6WdgYuB4+kGEvKfBxGosfTtw1U4WNidebcb nZFp5iUajLUaw==
Received: by pali.im (Postfix) id BC725786; Fri, 9 Aug 2024 11:00:08 +0200 (CEST)
Date: Fri, 09 Aug 2024 11:00:08 +0200
From: Pali Rohár <pali-ietf-nfsv4@ietf.pali.im>
To: Rick Macklem <rick.macklem@gmail.com>
Message-ID: <20240809090008.tzlq4vy5jmxckcqn@pali>
References: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
User-Agent: NeoMutt/20180716
Message-ID-Hash: JNBK6NSV2E7ACFMBXRUWS4DTBRGO45QS
X-Message-ID-Hash: JNBK6NSV2E7ACFMBXRUWS4DTBRGO45QS
X-MailFrom: pali-ietf-nfsv4@ietf.pali.im
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-nfsv4.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: NFSv4 <nfsv4@ietf.org>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operations
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/Ssa6wSZe58Yhg3fl4FIjej5mwJU>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Owner: <mailto:nfsv4-owner@ietf.org>
List-Post: <mailto:nfsv4@ietf.org>
List-Subscribe: <mailto:nfsv4-join@ietf.org>
List-Unsubscribe: <mailto:nfsv4-leave@ietf.org>
Hello, if I understand correctly then this functionality could be already possible via NFS v4.1 by using persistent reply cache of the session. RFC 8881 section 2.10.6.5. says: "A persistent reply cache places certain demands on the server. The execution of the sequence of operations (starting with SEQUENCE) and placement of its results in the persistent cache MUST be atomic." It should be enough for a NFS v4.1 client to create a new session with flag CREATE_SESSION4_FLAG_PERSIST and place those "atomic" operations into that session. On Thursday 08 August 2024 13:36:25 Rick Macklem wrote: > Hi, > > Over the years, I've run into cases where it would be really > nice to be able to perform multiple NFSv4 operations on a > file without other operations done by other clients > "gumming up the works" by changing the file's data/metadata > between the operations in the compound. > > So, what do others think about an extension to NFSv4.2 that > adds 2 new operations: > MUTEX_BEGIN(CFH) > MUTEX_END(CFH) > Both would use the CFH as argument, and no other client would > be allowed to perform operations on the CFH between the MUTEX_BEGIN > and MUTEX_END. > > I think there would need to be a couple of properties for these: > - There would need to be an "implicit" MUTEX_END when any operation > between MUTEX_BEGIN and MUTEX_END returns a status other than NFS_OK. > - I think you would want a restriction of only one mutex for one CFH > at a time in a compound. Without that, there could easily be deadlocks > caused by other compounds acquiring mutexes on the same CFHs in a > different order. > - Only one compound can hold a mutex on a given CFH at any time. > - MUTEX_BEGIN/MUTEX_END can only be used in compounds where SEQUENCE > is the first operation. > - All mutexes are discarded by a server when it crashes/recovers. > (Any time a client receives a NFS4ERR_STALE_CLIENTID.) > That way RPC retries after a server reboot should work ok, I think? > > I am not sure what the semantics for reading data/metadata should be, > but I was thinking that would be allowed to be done by compounds for > other clients for the CFH. If a client wanted to serialize against > other compounds for the CFH, it could do a MUTEX_BEGIN/MUTEX_END. > > I see this as useful in a variety of ways: > - The example in the previous email of: > MUTEX_BEGIN > NVERIFY acl_truform ACL_MODEL_NFS4 > SETATTR posix_access_acl > MUTEX_END > - Append writing: > MUTEX_BEGIN > VERIFY size "offset in WRITE that follows" > WRITE "offset" etc > MUTEX_END > - A bunch of cases where NFSv4 lacks the postop_attributes > that were in NFSv3. > MUTEX_BEGIN > WRITE > GETATTR size, change,.. > MUTEX_END > > So, what do others think? > (This was obviously not possible without sessions.) > > rick
- [nfsv4] RFC: new MUTEX_BEGIN/MUTEX_END operations Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Tom Haynes
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Chuck Lever III
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Jeff Layton
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Pali Rohár
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Trond Myklebust
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem
- [nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operat… Rick Macklem