[nfsv4] Re: RFC: new MUTEX_BEGIN/MUTEX_END operations
Rick Macklem <rick.macklem@gmail.com> Thu, 08 August 2024 20:46 UTC
Return-Path: <rick.macklem@gmail.com>
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 0276BC14F6BF for <nfsv4@ietfa.amsl.com>; Thu, 8 Aug 2024 13:46:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 vopZcrZp1xsk for <nfsv4@ietfa.amsl.com>; Thu, 8 Aug 2024 13:46:56 -0700 (PDT)
Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 88531C14F696 for <nfsv4@ietf.org>; Thu, 8 Aug 2024 13:46:56 -0700 (PDT)
Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7a1be7b5d70so1112363a12.0 for <nfsv4@ietf.org>; Thu, 08 Aug 2024 13:46:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723150016; x=1723754816; darn=ietf.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ZFpJfODGIf1piDgnTREE5o3hjs4nrAjHLljjbkYH3Nw=; b=eEq9jk0WPlkeqD3nK+o3Y+WIWjod0uq5hhRzCLXWiVtO+DDb1/RrVEUKFZheog8DVX qdnF1c+6JxCyxHel6vTm2lkwsxGgGLkMtbwJIgwzZa9CQzj58jSaOPwt8a5YVn3WXdzJ 6o1kgTkvHJIvrfVEV2Dl7jImJTJMmPkCw0oIV59r7/lfGFX+fqFZ2aF3lv4YorC4Ks/0 iZZEVK3XVN0iRgP0jZNhYQgErLLP0hRzmeCV+Y4zEnM7GRrc+UusNWBmoYpCtRRVSxmW Guu1X/zSuYnhwAlEvEAUep8VoFkyUQmZA9rwsxgd1zKqbvmjqSD3xfD02ItO8HLsbGdT 6jGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723150016; x=1723754816; h=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=ZFpJfODGIf1piDgnTREE5o3hjs4nrAjHLljjbkYH3Nw=; b=R3MBHelQ0T1Kna04/yY8jIfpxy9Jf9Q5jySPo1RRY0QL5N8gPxCOYe1TKuaOaZe6VS fNL5xvmtSh0phuc/K3VdCRd3io6zBYhBajdbPIO+uZ570MB0f4NBkoZNdQo43DAks4zR VcJF4vNbnZN6kSuYStA9nR4huO78MZdYzMqtK60ertsi2uesqrDyXgx+3l5OAZ3OP1/N NZDgIPGDIuDFIshgBQBYYr4Hy/6Mj+ji/+VHEnffkGKoVdi/C54rnV+8TlKlqrl3L5xI qWo5Jd5trijwxFdVxHRdGUyTfyKbQal8DT1RDD3R8b0IsGs/Rnibd7lpoNeJOBMP7NTX UowA==
X-Gm-Message-State: AOJu0Yxb2YQ3fgZO4uy6ZYSB2d4VZTg8XKMCXU80lHfNcyxiTUl5NPqu n41DxOIOAmY7TOdAO6eHklXv3esBg/INtLH0j0MHrdGtuXXQjaYwJTzBzYxMMe+C2x/7m4xT6C0 TYpBYER0WAjDPiIPSHsSwducJwjTk
X-Google-Smtp-Source: AGHT+IHoBBPC9dN7flypAktcmhIZqmqThuPX5sIrPCon5rEYk1s281b4ZHerVXwH07AQCim7uflmaHiD0lsyk8WKjfk=
X-Received: by 2002:a17:90a:67ca:b0:2c8:4250:66a7 with SMTP id 98e67ed59e1d1-2d1c4f7fcf3mr4503689a91.1.1723150015503; Thu, 08 Aug 2024 13:46:55 -0700 (PDT)
MIME-Version: 1.0
References: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
In-Reply-To: <CAM5tNy7g+YCiiZQD7G6Ryv_Mo8N5BeRiqMP=224zPpEXa+Yi+A@mail.gmail.com>
From: Rick Macklem <rick.macklem@gmail.com>
Date: Thu, 08 Aug 2024 13:46:46 -0700
Message-ID: <CAM5tNy7qO-b8HB+0xwLbmed6oMbWVO5xksCyn5VJnxy+D9-kwg@mail.gmail.com>
To: NFSv4 <nfsv4@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000091a7b7061f322010"
Message-ID-Hash: LFMC5RYJKGUGDU5JS53M52EENLLKSAS5
X-Message-ID-Hash: LFMC5RYJKGUGDU5JS53M52EENLLKSAS5
X-MailFrom: rick.macklem@gmail.com
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
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/SC7rzo5YY89e4H7m0iks4tv19NM>
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>
Oh, one thing I missed... On Thu, Aug 8, 2024 at 1:36 PM Rick Macklem <rick.macklem@gmail.com> 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. > - When a mutex is held by another compound in progress for a an FH, MUTEX_BEGIN would reply with an error (NFS4ERR_LOCKED maybe). > - 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