From patchwork Fri Aug 23 18:14:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 13775693 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D7EE1925B0; Fri, 23 Aug 2024 18:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724436873; cv=none; b=hFweimVQMVpVmLMgNHPVA62yatZYIvvujlVR58n0MCWVHIuqO1wmE0FT1t4HAZyQkc5Al6npukf6fEbVu6Amc0T4f+7IdU2Qsbwvrj4FCQ8QLFSiMLM1ZuE+oC5kj/D/SdEkGfB4Cgh4DsjOITsI13D88hzkWwmxcoCRvO5Gfmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724436873; c=relaxed/simple; bh=sr03EmomsHBukis3MHoLZ8JDIsGx0uE2tUIIuCFaF7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ScYx+QV+A0qt/w32SSsjRmPJ63+2JfvfefaGJETy+haPGYUIAPtjWEVMBKt1cSyKMD4vPynv1PWArAiRZkZMMUb2KJskFMu9VkaWI85l6an6iHGjp+LHvrhKaBA5U6sP2+mIjFeo4NdmvIgIQ6Lk9j7Onjw+5F2L+cIHORMUKq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PxnZsZ83; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PxnZsZ83" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C154C4AF10; Fri, 23 Aug 2024 18:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724436873; bh=sr03EmomsHBukis3MHoLZ8JDIsGx0uE2tUIIuCFaF7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PxnZsZ83QGFALnWNNV1/sRKx/gaT1zPdtNz2013NndVBpC/YozO/AQ4mCWJocYE4P 52E7cepZwJoQaxnv/k3Z9INniw3wCuD/h1kjOY4KSkLF1Z3jpigqUcvOaHr0tGDVly Ebxm4in7d5LbwXM6ATtc0KXwVT9hUF8iUcwIjo6wOyFF8PS1jfKU9ZYg50M35CBrMf ir7XH5Qim7JpcCmi2UVJI5i121dLz+4nl/phXk2jF09TuFKk/Yp9qi1cbQ9Kz1ghKK rVGras/0B0vtLzmPw0OmxdutfS9cEWAwIfVDE8ZYeD5c8tg0v6KSKUemyEJGBCWLCe FQvHeuxMkJPDg== From: Mike Snitzer To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Anna Schumaker , Trond Myklebust , NeilBrown , linux-fsdevel@vger.kernel.org Subject: [PATCH v13 06/19] SUNRPC: remove call_allocate() BUG_ONs Date: Fri, 23 Aug 2024 14:14:04 -0400 Message-ID: <20240823181423.20458-7-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240823181423.20458-1-snitzer@kernel.org> References: <20240823181423.20458-1-snitzer@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; 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; 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 Signed-off-by: Mike Snitzer --- 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