From patchwork Tue Mar 25 00:46:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 14027980 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 DE42F1862 for ; Tue, 25 Mar 2025 00:46:41 +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=1742863601; cv=none; b=u27+e5Vx+cx7NilWYtt/yZut3L2nb5kar2cnT7cMo7Y/DtfL3P+PlBccWrqUScoLY22FgADvEbvIXLRU1PnzlK+S9OrJeyMxhqKSlQtB/nLoQeNenynAfV3SkAnaKvkbXXVMhjCoPt9hjnsVByBw6F/hLZNDqFf4SzH9VO9aC8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742863601; c=relaxed/simple; bh=JK17KLGNOaSpdNMeCJAqxBTwpxTcr1VYwFmTm1hLze8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MCJQvMDUKsPHFYG9l9yuTzMqefYD5+PMCIJOCI0w5O+4mjZpeFOjzvMRw6wPeAcuWEJF/68ntX0uu+IoztNxsONNighyLtqTz6K2wI2X2BAAajaZT826BSe4XRJm2Z66j4uYMmqpugfmX3PuULcAItwsdx7BsLbflhG4GVPTdSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VkOE5BBo; 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="VkOE5BBo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83583C4CEE9; Tue, 25 Mar 2025 00:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742863601; bh=JK17KLGNOaSpdNMeCJAqxBTwpxTcr1VYwFmTm1hLze8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkOE5BBoYCXHtvLZrHtsv3Y3e+g2vz0jZRoZYxL5QRSV4b4xQlVkVkrEt899ZLuhT Yo3I20DClphWpMQo9KA/i4OF+2AJdqJw20xIHoR+6JJQrtxO2V7Cdk8oy8kyuCFR0b hmax4RwW1giQb2wBim3PB3059W2EYJ7HTId/ayGgqhBduFKg0NYyV8IfEFRiOTFv6g Yxt7B9TYxgHyvqF0/KRvFfASigFq/Px/9GkqpnurYPCofxO7GOoZzdVJhGSc+Fhsr7 Tl07QHZdvMZQZgdnTpxf5XDXJNQRdDWri1VXSSvEK8GwSaHtDfoVElHjOwUVNK6ZpH UCyLXkV47r1Jg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Josef Bacik Subject: [PATCH 1/4] SUNRPC: rpcbind should never reset the port to the value '0' Date: Mon, 24 Mar 2025 20:46:36 -0400 Message-ID: <8b9a709ef321aa246b9ef00a8bcfa71a77df4245.1742863168.git.trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Trond Myklebust If we already had a valid port number for the RPC service, then we should not allow the rpcbind client to set it to the invalid value '0'. Signed-off-by: Trond Myklebust --- net/sunrpc/rpcb_clnt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 102c3818bc54..53bcca365fb1 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -820,9 +820,10 @@ static void rpcb_getport_done(struct rpc_task *child, void *data) } trace_rpcb_setport(child, map->r_status, map->r_port); - xprt->ops->set_port(xprt, map->r_port); - if (map->r_port) + if (map->r_port) { + xprt->ops->set_port(xprt, map->r_port); xprt_set_bound(xprt); + } } /*