Subject: Re: [nfsv4] [PATCH] document stateid and filehandle rules for ALLOCATE and DEALLOCATE

From: Christoph Hellwig <[email-masked]>
Date: Tue, 28 Apr 2015 15:58:29 +0200

Sorry, forgot to Cc the nfsv4 list..

On Tue, Apr 28, 2015 at 03:54:46PM +0200, Christoph Hellwig wrote:
> diff --git a/nfsv42_middle_op_allocate.xml b/nfsv42_middle_op_allocate.xml
> index 293b4dc..cfd62d0 100644
> --- a/nfsv42_middle_op_allocate.xml
> +++ b/nfsv42_middle_op_allocate.xml
> @@ -35,6 +35,17 @@
>      </t>
>  
>      <t>
> +      CURRENT_FH must be a regular file. If CURRENT_FH is not a regular file,
> +      the operation MUST fail and return NFS4ERR_WRONG_TYPE.
> +    </t>
> +
> +    <t>
> +      The aa_stateid MUST refer to a stateid that is valid for a WRITE
> +      operation and follows the rules for stateids in Sections 8.2.5 and
> +      18.32.3 of <xref target='RFC5661' />.
> +    </t>
> +
> +    <t>
>        The server will ensure that backing blocks are reserved to the region
>        specified by aa_offset and aa_length, and that no future writes into
>        this region will return NFS4ERR_NOSPC. If the region lies partially or
> diff --git a/nfsv42_middle_op_deallocate.xml b/nfsv42_middle_op_deallocate.xml
> index fac011b..5bc7fa3 100644
> --- a/nfsv42_middle_op_deallocate.xml
> +++ b/nfsv42_middle_op_deallocate.xml
> @@ -36,7 +36,18 @@
>        operation will have no effect for the region that already is in unreserved
>        state.
>        All further reads from the region passed to DEALLOCATE MUST return zeros
> -      until overwritten.  The filehandle specified must be that of a regular file.
> +      until overwritten.
> +    </t>
> +
> +    <t>
> +      CURRENT_FH must be a regular file. If CURRENT_FH is not a regular file,
> +      the operation MUST fail and return NFS4ERR_WRONG_TYPE.
> +    </t>
> +
> +    <t>
> +      The da_stateid MUST refer to a stateid that is valid for a WRITE
> +      operation and follows the rules for stateids in Sections 8.2.5 and
> +      18.32.3 of <xref target='RFC5661' />.
>      </t>
>  
>      <t>
---end quoted text---