Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2747602rdb; Wed, 4 Oct 2023 10:10:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8Kc9PD0dopAE7uTKGYHketLRKEWapMukfn78r/w4KizBnUIaM/1f3Amb69SOV/yCIeqB8 X-Received: by 2002:a17:90b:1d0d:b0:274:6cc9:ec69 with SMTP id on13-20020a17090b1d0d00b002746cc9ec69mr2369579pjb.49.1696439410914; Wed, 04 Oct 2023 10:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696439410; cv=none; d=google.com; s=arc-20160816; b=trt2zAI/9E6g1rbUHhe84tPbtfmw2vJtCGVW73dZ0WewNyFoCWP1vWBJyiDMfmMUiC OA1ITa7Ku6bsFM5LnYitsgszF/yehU2wXiIZ2Fk1nUXVcIDCuTGSxI2HS8RABOqHudnD oJwjk3iA21Ufr2VORTXg/zYMqg9SLrkJohFH2SOZloNedZvJxOyzXgMv60DaRpHSO/d3 0UBLBCZEYGjshY2Wbv+5E0f59UCKMIC4yOGS64DwXcrTFhLO5sEAL+i5DAVe4dbO0aZa KvkaoBIMByEQHqqALw2EsULyGbR1Enx9otUSdlTsuing8r2qeWIpS07NgcaJJUgislLI uhmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=5JQnm5G2Ox5STa6CRsSBW0HoCmATHZafAc/MyPl/34c=; fh=Wl0PKZ0YFG7lJMy2Ttt74cd/c3K/wXfMSw3mC2yTI/c=; b=ycbbw5TbvoEGYSRUkUjxvzlbmlWQajshQIfBIcHaLWz9VEqIRPPr0w7Aa2JcGAGZdW 3gpMGAT4QIB2O1+7kiqwkN+Fo3FIrfEcZik+ULfeGuMwBXoXWzqvKw4Hn1VuTBVK0Gvk THn0CBfKBXYUEupAc8jSIqQf04LXm/Yixtx5JTspKNJZ2MB8mHdFVL5Wf8/lehRWJ9qG b48qEkIo5NNqgchhvM/9bfLsQk1G20CW3Bijfi2gjb+LaNaFuZBgQCYJBSeoS52XiO2c lkLOxahNtHsHyGf4FDyj8feNBGOW3PKM+fPYBpITDZu2gKHd5WXizCS7Gek5teUOSeKH /qeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ien6Kfh8; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id in24-20020a17090b439800b002768ab837bfsi1891352pjb.48.2023.10.04.10.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ien6Kfh8; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 866918158338; Wed, 4 Oct 2023 10:10:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243627AbjJDRJ7 (ORCPT + 99 others); Wed, 4 Oct 2023 13:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243548AbjJDRJ7 (ORCPT ); Wed, 4 Oct 2023 13:09:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F4195 for ; Wed, 4 Oct 2023 10:09:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AE56C433C8; Wed, 4 Oct 2023 17:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696439396; bh=EejapxRAgzw+TAYKfTQScOAAgVEo1P7QSBw6SBgbl0E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ien6Kfh8QrpLdbtZd/84HBk4hJcAVbWO4B9tT1IHnB8HiSZkRqG/4G4HyPjC+V6nC r2rrjQbcNaNRW/luHjanjXTAjjDFM9ssYAbsV1W/a+fxikguz9MPnUYz/MwV5742Zc PMXucSW8D5dB4yYFEY43ytaZi0JF8W1QQ5QXpnlLhiESD08WKWsQJ7h5zzI1KVDjSE NtXxCDaNJ1+SmPq20YwQwUNirS8n2zGrM8jpBzTAdmyva/adGSSd1JdGCfjLciIIng TXaLjK9MksYoYdUytDhL5UKMmjeOW7OXGFEW1uDoG5tF7rt8Y6gecyxtyzVcdmDx4/ pCBe691JRHiBg== Date: Wed, 4 Oct 2023 10:09:55 -0700 From: Jakub Kicinski To: Lorenzo Bianconi Cc: linux-nfs@vger.kernel.org, lorenzo.bianconi@redhat.com, jlayton@kernel.org, neilb@suse.de, chuck.lever@oracle.com, netdev@vger.kernel.org Subject: Re: [PATCH v3] NFSD: convert write_threads, write_maxblksize and write_maxconn to netlink commands Message-ID: <20231004100955.32417c33@kernel.org> In-Reply-To: <27646a34a3ddac3e0b0ad9b49aaf66b3cee5844f.1695766257.git.lorenzo@kernel.org> References: <27646a34a3ddac3e0b0ad9b49aaf66b3cee5844f.1695766257.git.lorenzo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:10:08 -0700 (PDT) On Wed, 27 Sep 2023 00:13:15 +0200 Lorenzo Bianconi wrote: > +int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info) > +{ > + u32 nthreads; > + int ret; > + > + if (!info->attrs[NFSD_A_CONTROL_PLANE_THREADS]) > + return -EINVAL; Consider using GENL_REQ_ATTR_CHECK(), it will auto-add nice error message to the reply on error. > + nthreads = nla_get_u32(info->attrs[NFSD_A_CONTROL_PLANE_THREADS]); > + > + ret = nfsd_svc(nthreads, genl_info_net(info), get_current_cred()); > + return ret == nthreads ? 0 : ret; > +} > + > +static int nfsd_nl_get_dump(struct sk_buff *skb, struct netlink_callback *cb, > + int cmd, int attr, u32 val) YNL will dutifully return a list for every dump. If you're only getting a single reply 'do' will be much better.