]> git.infradead.org Git - users/hch/misc.git/commitdiff
SUNRPC: remove call_allocate() BUG_ONs
authorMike Snitzer <snitzer@kernel.org>
Thu, 5 Sep 2024 19:09:45 +0000 (15:09 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 23 Sep 2024 19:03:30 +0000 (15:03 -0400)
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).

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
net/sunrpc/clnt.c

index 5e9f36505ab70d8167aa5999bed4da7f5626e1d7..0090162ee8c350568c91f1bcd951675ac3ae141c 100644 (file)
@@ -1888,12 +1888,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