Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp134317iob; Tue, 17 May 2022 21:24:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/LLR1ckzS4uIXiuB25OeC00bQ+dzKW4izqnG9gezAPh38fC62BRDboJ4d6eMK3g99wzP+ X-Received: by 2002:a63:cd42:0:b0:3db:3307:3a6 with SMTP id a2-20020a63cd42000000b003db330703a6mr22099501pgj.620.1652847858263; Tue, 17 May 2022 21:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652847858; cv=none; d=google.com; s=arc-20160816; b=066mc/pIrmj27AEvD3Ss6/zi+BrNpRY56HO85l4lfz09wOklfStCKpQDqQqNRoI1Xy YA8NpcA0fPxQNpeOVb6JTgM8XU1AKM7F6kxyTUMQ5COD2XXVkxV/+5pHgRNjtmOk9Rhc 7+peQPlEcHyx6wVgbBQruvoZx/how8KT2iY9DeG2IJnV0gW7vkMvupEWzDNOGyFqWCc7 yP2n9qkj5MEMcf7kQl/RxoVdrv+hSD+U/cZdj/IQy79cUZOVNDCrW6kdcwAqiuJcmEK1 EHGqr2FCwb8uhiId8FwV+GesnliMIJae2m0OGNSQO36T1cPnCpLxM6FHPhjBrn8zBDf8 Xiow== 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=ynXxyBUpHmasGyAzhPJm2KZzJCrsxenE3tmFRtT1Mx0=; b=tkn/G9XyIeEw32Ut9SOd7FE9cLqZrwiu1yGKClqS6EfAQwMS1sDFE9/+5cEqiwZQdq lu6aReiMI0ce3todsz1dRaf3sESSMGhLG1ieY65s41gNM+Yy4sTkgaU31F0lWdGw4p7r EjjlBJSnQzirvaBb+qQisG/NU0SjyQlssUI4oQb6DaguKdDa3QG+7BsjJ8kN3KIjnuxl AD2cah428G7QyJ5H5P9HvlP9w+IFLIsir9D5M0tDdtDZrU4r+C/OGB5JeK+omEIMlWGP u2jvF4+qig2Pqkw3M05IF+2IpEziVXozHLdZxFgGHNVHFCo9c1SCwbgRt7VJpg8zAFvN Cprg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ef8kauu7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id hr9-20020a17090b138900b001c73b8066e0si1369507pjb.74.2022.05.17.21.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:24:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ef8kauu7; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 152B76F4A7; Tue, 17 May 2022 20:48:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231358AbiEQWdk (ORCPT + 99 others); Tue, 17 May 2022 18:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbiEQWdc (ORCPT ); Tue, 17 May 2022 18:33:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 727483EABD; Tue, 17 May 2022 15:33:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C93356132C; Tue, 17 May 2022 22:33:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E060AC385B8; Tue, 17 May 2022 22:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652826808; bh=fMWd8B6Azz1Yz4Q3JOgMXGVN+v5a30E1TxzHvyasM/E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ef8kauu7i4yL96jbmNJ8mid/7sgRdte2U9SyhJ5bRw/wbmgD6shB6YPtkZAwhJda8 kWpfVmxQ/tGMgicfnMaqkXz0BG9a6U50A+Kc8UNDkr3tvKoJ18kv9fh9Fd0d7pzrzR KKB02cmMlYDKFukiBLCIrmoGs+YJhn6qPkeV2o6MjdnnrbfN/ljm6z2ecXCcgxfcsQ g4AF/UcVvryB9rTWbMzG6gW+ptOVJEs0YM68i2XRuZS+uO1CKCF8QLRL/5C/wmCUuf o+FpdZ4UJaQyLJGhqP83LlE0FhD/QxuCXZfgxHpazA5Y8D51KLXcFCGhaxKScObtUZ TJ4oWJB74GTSg== Date: Tue, 17 May 2022 15:33:26 -0700 From: Jakub Kicinski To: Jay Vosburgh Cc: Jonathan Toppins , netdev@vger.kernel.org, Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org Subject: Re: [RFC net-next] bonding: netlink error message support for options Message-ID: <20220517153326.1fbbe2cc@kernel.org> In-Reply-To: <2125.1652821874@famine> References: <5a6ba6f14b0fad6d4ba077a5230ee71cbf970934.1652819479.git.jtoppins@redhat.com> <2125.1652821874@famine> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-kernel@vger.kernel.org On Tue, 17 May 2022 14:11:14 -0700 Jay Vosburgh wrote: > If I'm reading the code correctly, rtnl isn't held that long. > Once the ->doit() returns, rtnl is dropped, but the copy happens later: > > rtnetlink_rcv() > netlink_rcv_skb(skb, &rtnetlink_rcv_msg) > rtnetlink_rcv_msg() [ as cb(skb, nlh, &extack) ] > rtnl_lock() > link->doit() [ rtnl_setlink, rtnl_newlink, et al ] > rtnl_unlock() > netlink_ack() > > inside netlink_ack(): > > if (nlk_has_extack && extack) { > if (extack->_msg) { > WARN_ON(nla_put_string(skb, NLMSGERR_ATTR_MSG, > extack->_msg)); > } Indeed. > Even if the strings have to be constant (via NL_SET_ERR_MSG), > adding extack messages is likely still an improvement. At a quick glance it seems like the major use of the printf here is to point at a particular option. If options are carried in individual attributes pointing at the right attribute with NL_SET_ERR_MSG_ATTR() should also be helpful. Maybe that's stating the obvious.