From nobody Sun Oct 10 03:52:11 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 05D3912D323A for ; Sun, 10 Oct 2021 03:52:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRp0X5XDPz3vmC for ; Sun, 10 Oct 2021 03:52:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f182.google.com with SMTP id y207so16295129oia.11 for ; Sat, 09 Oct 2021 20:52:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/+zo47dlabmOEht0Fs/tPJduvkd8Oz9Pwf2Mq5tT1d0=; b=eKTs8sBm6LycqonFyHVW7euO0c072JgSOx+wdxHUZkP32Z3tQCH/jci40ehklsJCru mZmKuqYDE+ixbHERvxBuMhYHqAPFuMOQjfXc/g1MnftI1/I3hY2DPFRcGPsFzD4iKxDO 3C339++RqW/k1/woJOOfn9QnyQPQsTswjgBc0SuhlNWYPp7SwFvnNTiCXiUMFAPabpMA igZqdNU3zNWnY3KqLew2W1Dbjj2kMbimD63q9hq5NmR9MBx+mC8NRmWU/O23eeA6Z5O2 /tfL8E4kK520+oPlmXkmaXAyedjN4el8E8/iF17nvPsdQ+E794a8GlPHdbh2MK8bewMZ NMRQ== X-Gm-Message-State: AOAM5335w3f9rouJw+Fp9GL3ER6qClZ7hpGcQRbsgLczd5wlEQFZye4M T7QOvIdI2a+NPotzjG31hufOqZ3vBNcs4zCYTTo3GxSr X-Google-Smtp-Source: ABdhPJw9+X0t7Xxf80HRA7vvO7LHh3FvyKKTGv4xXFaX2bylDlIRstNWO6BLILBQHVJJk/X53bv860jj5ndlB2ObZAM= X-Received: by 2002:a54:4f0e:: with SMTP id e14mr13905418oiy.73.1633837942076; Sat, 09 Oct 2021 20:52:22 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Sat, 9 Oct 2021 21:52:11 -0600 Message-ID: Subject: Re: RFC: Use of VOP_ALLOCATE() by NFSV4.2 nfsd To: Rick Macklem Cc: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HRp0X5XDPz3vmC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Oct 9, 2021 at 7:13 PM Rick Macklem wrote: > > Hi, > > I ran into an issue this week during the nfsv4@ietf.org's testing event. > UFS - supports VOP_ALLOCATE() by using vop_stdallocate(). > ZFS - just return EINVAL for VOP_ALLOCATE(). > > An NFSv4.2 server can either support Allocate or not, but it has to be > for all exported file systems. That seems like a protocol bug to me. Could this be fixed in a future NFS revision? > > This leads me to a couple of questions: > - Is there a good reason for not using vop_stdallocate() for ZFS? Yes. posix_fallocate is supposed to guarantee that subsequent writes to the file will not fail with ENOSPC. But ZFS, being a copy-on-write file system, cannot possibly guarantee that. See SVN r325320. > - Should I try and support both file system types via vop_stdallocate() > or not support Allocate at all? Since you can't possibly support it for ZFS (not to mention other file systems like fusefs) you'll have to not support it at all. > > Btw, as a bit of an aside, "cc" uses posix_fallocate() and in weird ways, > such as offset=0, len=1. Why, I have no idea? > > Thanks in advance for any comments, rick >