From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11400C433B4 for ; Wed, 7 Apr 2021 13:31:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2134601FB for ; Wed, 7 Apr 2021 13:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244346AbhDGNb1 (ORCPT ); Wed, 7 Apr 2021 09:31:27 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:32678 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233670AbhDGNbW (ORCPT ); Wed, 7 Apr 2021 09:31:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1617802273; x=1649338273; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=i7hlHMG28rhEXW1gdvzu6kYB/Chk8WSxsF3sJB/4Zi8=; b=W1Mq2OYNwva+X07B9Vn2DDJYbMoG/yKmnkUVLkhBnFKRj5z1A2/BbvhK gYNXKXkLzzkX2U6drpTyKS+2Eq+VvbvnbwYsAoidmml5mgYg53qIv63j1 N0x2FY2X0myP2h2djVPguCf4zbFkgXVBz7Rmu8IwYtIodes1SrmZUrhJQ E=; X-IronPort-AV: E=Sophos;i="5.82,203,1613433600"; d="scan'208";a="100027995" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-579b7f5b.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 07 Apr 2021 13:31:02 +0000 Received: from EX13D19EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2c-579b7f5b.us-west-2.amazon.com (Postfix) with ESMTPS id 85741A284D; Wed, 7 Apr 2021 13:31:00 +0000 (UTC) Received: from 8c85908914bf.ant.amazon.com (10.43.161.102) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Apr 2021 13:30:56 +0000 Subject: Re: [PATCH for-next v2] RDMA/nldev: Add copy-on-fork attribute to get sys command To: Leon Romanovsky CC: Jason Gunthorpe , Doug Ledford , Yossi Leybovich , , Alexander Matushevsky , Jason Gunthorpe , Peter Xu , Mike Kravetz , Andrew Morton References: <20210407101606.80737-1-galpress@amazon.com> <6d62496e-6bc7-4981-d3ef-5035c6fee93b@amazon.com> From: Gal Pressman Message-ID: <010c6b45-a9b0-67c7-82e3-78533a532225@amazon.com> Date: Wed, 7 Apr 2021 16:30:50 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.161.102] X-ClientProxiedBy: EX13D24UWB002.ant.amazon.com (10.43.161.159) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 07/04/2021 16:23, Leon Romanovsky wrote: > On Wed, Apr 07, 2021 at 04:14:46PM +0300, Gal Pressman wrote: >> On 07/04/2021 15:39, Leon Romanovsky wrote: >>>> @@ -1710,7 +1721,8 @@ static int nldev_set_sys_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh, >>>> >>>> err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, >>>> nldev_policy, extack); >>>> - if (err || !tb[RDMA_NLDEV_SYS_ATTR_NETNS_MODE]) >>>> + if (err || !tb[RDMA_NLDEV_SYS_ATTR_NETNS_MODE] || >>>> + tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]) >>> >>> Why do we fail if user supplies RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK? >> >> It's a read-only attribute, if someone tries to set its value I assume it's best >> to return an error. > > Not in netlink world, you need to ignore the parameters that > you don't "know how to handle" and check for must-to-be input only. Not sure I understand. So you expect the set function to remain unchanged in this patch? Isn't it bad that a user can request to change the copy on fork value and get a success return value although nothing happened?