diff mbox series

[v14,11/25] SUNRPC: remove call_allocate() BUG_ONs

Message ID 20240829010424.83693-12-snitzer@kernel.org (mailing list archive)
State New
Headers show
Series nfs/nfsd: add support for LOCALIO | expand

Commit Message

Mike Snitzer Aug. 29, 2024, 1:04 a.m. UTC
Remove BUG_ON if p_arglen=0 to allow RPC with void arg.
Remove BUG_ON if p_replen=0 to allow RPC with void return.

The former was needed for the first revision of the LOCALIO protocol
which had an RPC that took a void arg:

    /* raw RFC 9562 UUID */
    typedef u8 uuid_t<UUID_SIZE>;

    program NFS_LOCALIO_PROGRAM {
        version LOCALIO_V1 {
            void
                NULL(void) = 0;

            uuid_t
                GETUUID(void) = 1;
        } = 1;
    } = 400122;

The latter is needed for the final revision of the LOCALIO protocol
which has a UUID_IS_LOCAL RPC which returns a void:

    /* raw RFC 9562 UUID */
    typedef u8 uuid_t<UUID_SIZE>;

    program NFS_LOCALIO_PROGRAM {
        version LOCALIO_V1 {
            void
                NULL(void) = 0;

            void
                UUID_IS_LOCAL(uuid_t) = 1;
        } = 1;
    } = 400122;

There is really no value in triggering a BUG_ON in response to either
of these previously unsupported conditions.

NeilBrown would like the entire 'if (proc->p_proc != 0)' branch
removed (not just the one BUG_ON that must be removed for LOCALIO's
immediate needs of returning void).

Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
 net/sunrpc/clnt.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Jeff Layton Aug. 29, 2024, 3:58 p.m. UTC | #1
On Wed, 2024-08-28 at 21:04 -0400, Mike Snitzer wrote:
> Remove BUG_ON if p_arglen=0 to allow RPC with void arg.
> Remove BUG_ON if p_replen=0 to allow RPC with void return.
> 
> The former was needed for the first revision of the LOCALIO protocol
> which had an RPC that took a void arg:
> 
>     /* raw RFC 9562 UUID */
>     typedef u8 uuid_t<UUID_SIZE>;
> 
>     program NFS_LOCALIO_PROGRAM {
>         version LOCALIO_V1 {
>             void
>                 NULL(void) = 0;
> 
>             uuid_t
>                 GETUUID(void) = 1;
>         } = 1;
>     } = 400122;
> 
> The latter is needed for the final revision of the LOCALIO protocol
> which has a UUID_IS_LOCAL RPC which returns a void:
> 
>     /* raw RFC 9562 UUID */
>     typedef u8 uuid_t<UUID_SIZE>;
> 
>     program NFS_LOCALIO_PROGRAM {
>         version LOCALIO_V1 {
>             void
>                 NULL(void) = 0;
> 
>             void
>                 UUID_IS_LOCAL(uuid_t) = 1;
>         } = 1;
>     } = 400122;
> 
> There is really no value in triggering a BUG_ON in response to either
> of these previously unsupported conditions.
> 
> NeilBrown would like the entire 'if (proc->p_proc != 0)' branch
> removed (not just the one BUG_ON that must be removed for LOCALIO's
> immediate needs of returning void).
> 
> Reviewed-by: NeilBrown <neilb@suse.de>
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> ---
>  net/sunrpc/clnt.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index 09f29a95f2bc..00fe6df11ab7 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -1893,12 +1893,6 @@ call_allocate(struct rpc_task *task)
>  	if (req->rq_buffer)
>  		return;
>  
> -	if (proc->p_proc != 0) {
> -		BUG_ON(proc->p_arglen == 0);
> -		if (proc->p_decode != NULL)
> -			BUG_ON(proc->p_replen == 0);
> -	}
> -
>  	/*
>  	 * Calculate the size (in quads) of the RPC call
>  	 * and reply headers, and convert both values

Yay! More unneeded BUG_ONs gone.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff mbox series

Patch

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 09f29a95f2bc..00fe6df11ab7 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1893,12 +1893,6 @@  call_allocate(struct rpc_task *task)
 	if (req->rq_buffer)
 		return;
 
-	if (proc->p_proc != 0) {
-		BUG_ON(proc->p_arglen == 0);
-		if (proc->p_decode != NULL)
-			BUG_ON(proc->p_replen == 0);
-	}
-
 	/*
 	 * Calculate the size (in quads) of the RPC call
 	 * and reply headers, and convert both values