Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1819165rwb; Fri, 28 Jul 2023 15:56:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9jLtm/+KfmYHoqLlOasdhMqVupz3VcnsxzPn3cJnMdM71CLx7pPdrRmXNXIjXa8x15xjX X-Received: by 2002:a17:906:109e:b0:96f:8439:6143 with SMTP id u30-20020a170906109e00b0096f84396143mr532369eju.40.1690584969137; Fri, 28 Jul 2023 15:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690584969; cv=none; d=google.com; s=arc-20160816; b=05be5nwHopDMwHfuIjDLiDfKEUCY5o5XMsj6ZlE6w4/3OdqnP7oU/2v373D6w1njEw dOp/gVm5199jgzeDDzEWziushrcQGxjkYp1NSlhw0im+WvthXayVdGwA6xLuX0TKzS+3 1Z8kX6t5heT4SEhCACNDYKpCbIemwupVTdHsSnXYuLv8mannCEpmjfs9nqcntqTgYbmw AuuUEsKOqsa9mbtJrS/6A4zwyAP2SzUg5q9FzFWpHFQT+fa43KrwFAQZJB3ACmhbjyRN GPHOeD4zDBBII4nelhe46lF3gk8XM88pU5+invKP7/L68U/k4i2yF7uGVpg+AeR4kdue RoYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=5kLMwARu70gSWHYmOi4s/pBx0/Zye4clT032Nwsd9pg=; fh=H/qF0IkKrMBbAAkFTFSLDer9qQUuzimiqgPJFDJyCTs=; b=XMo2ZyktPcYFNb04YuulxnWauAwgU7aXVsBhb7Rui3DNvFnyr8FamSopR+YW3Cvgeu 2aYO/EM+dciP60VubRgpUXNKIh+aWJMbERfLLhs0cya6qj8MF97vrPkmYNXj22UpNvkC uvrQLQAv7DauADXa4g+j1nJMFB3u6ZM3kLPrpQwdZChvyQVSrTtUToElpJ/SsBtdiv1x H4rc2Twev/J3lO7diojgmIF81EMKPNNzpEu4CVgY5L77jRa5nLdGroooOOYMOnI6/Eib UikkdBLtg4og8qsWYhSjQY3ObJHOriUWRn2s+BsY9nsvsvExCDa05PfwQAT5bVu0IVcK micg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GL5f8UPG; dkim=neutral (no key) header.i=@suse.de header.b=tG7T+6hB; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170906970d00b009922cdfaf62si3517447ejx.42.2023.07.28.15.55.43; Fri, 28 Jul 2023 15:56:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GL5f8UPG; dkim=neutral (no key) header.i=@suse.de header.b=tG7T+6hB; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbjG1WNV (ORCPT + 99 others); Fri, 28 Jul 2023 18:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjG1WNV (ORCPT ); Fri, 28 Jul 2023 18:13:21 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36B8448A for ; Fri, 28 Jul 2023 15:13:19 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2FB11218F2; Fri, 28 Jul 2023 22:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690582398; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5kLMwARu70gSWHYmOi4s/pBx0/Zye4clT032Nwsd9pg=; b=GL5f8UPGCBqf5bI6EnP0t5asS2RNnPTLrcDGq6asxy1Kj5jHd6x4wxaLnKy0PSZd8RSOPW jMOcPZeugnZEbEdvgmpJy3eHv7mmI2JGKw/uPTLjXig6gMWakTjdaiaKvl79bwwGBYEzlE nnuKbvEpttL4Lg3L7ov5zgm3PJxHEUI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690582398; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5kLMwARu70gSWHYmOi4s/pBx0/Zye4clT032Nwsd9pg=; b=tG7T+6hB4gbdKGJQint0g5MQXbOKCQ69VHgNsqY25cJdkM4HanWXyCd1x7nx3JN56GgoYV k8fANwawybUloqCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5092B133F7; Fri, 28 Jul 2023 22:13:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kD9cAXw9xGRyXAAAMHmgww (envelope-from ); Fri, 28 Jul 2023 22:13:16 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Lorenzo Bianconi" Cc: linux-nfs@vger.kernel.org, lorenzo.bianconi@redhat.com, chuck.lever@oracle.com, jlayton@kernel.org Subject: Re: [PATCH v4 1/2] SUNRPC: add verbose parameter to __svc_print_addr() In-reply-to: <5b0eff4e3ef9bf9621f5095189933f60def40f0d.1690569488.git.lorenzo@kernel.org> References: , <5b0eff4e3ef9bf9621f5095189933f60def40f0d.1690569488.git.lorenzo@kernel.org> Date: Sat, 29 Jul 2023 08:13:13 +1000 Message-id: <169058239308.32308.14184895022271604035@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, 29 Jul 2023, Lorenzo Bianconi wrote: > Introduce verbose parameter to utility routine in order to reduce output > verbosity. This is a preliminary patch to add rpc_status entry in nfsd > debug filesystem in order to dump pending RPC requests debugging > information. >=20 > Signed-off-by: Lorenzo Bianconi > --- > include/linux/sunrpc/svc_xprt.h | 12 ++++++------ > net/sunrpc/svc_xprt.c | 2 +- > 2 files changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xpr= t.h > index a6b12631db21..1715d4c6bd6b 100644 > --- a/include/linux/sunrpc/svc_xprt.h > +++ b/include/linux/sunrpc/svc_xprt.h > @@ -209,21 +209,21 @@ static inline unsigned short svc_xprt_remote_port(con= st struct svc_xprt *xprt) > } > =20 > static inline char *__svc_print_addr(const struct sockaddr *addr, > - char *buf, const size_t len) > + char *buf, const size_t len, > + bool verbose) > { > const struct sockaddr_in *sin =3D (const struct sockaddr_in *)addr; > const struct sockaddr_in6 *sin6 =3D (const struct sockaddr_in6 *)addr; > =20 > switch (addr->sa_family) { > case AF_INET: > - snprintf(buf, len, "%pI4, port=3D%u", &sin->sin_addr, > - ntohs(sin->sin_port)); > + snprintf(buf, len, "%pI4, %s%u", &sin->sin_addr, > + verbose ? "port=3D" : "", ntohs(sin->sin_port)); I would move the "," into the verbose part too. so verbose ? ", port=3D" : " " Other than that, I like this approach. NeilBrown > break; > =20 > case AF_INET6: > - snprintf(buf, len, "%pI6, port=3D%u", > - &sin6->sin6_addr, > - ntohs(sin6->sin6_port)); > + snprintf(buf, len, "%pI6, %s%u", &sin6->sin6_addr, > + verbose ? "port=3D" : "", ntohs(sin6->sin6_port)); > break; > =20 > default: > diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c > index 62c7919ea610..16b794d291a4 100644 > --- a/net/sunrpc/svc_xprt.c > +++ b/net/sunrpc/svc_xprt.c > @@ -386,7 +386,7 @@ EXPORT_SYMBOL_GPL(svc_xprt_copy_addrs); > */ > char *svc_print_addr(struct svc_rqst *rqstp, char *buf, size_t len) > { > - return __svc_print_addr(svc_addr(rqstp), buf, len); > + return __svc_print_addr(svc_addr(rqstp), buf, len, true); > } > EXPORT_SYMBOL_GPL(svc_print_addr); > =20 > --=20 > 2.41.0 >=20 >=20