Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp143689iob; Tue, 17 May 2022 21:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAvRGA4dv2koQRUunftqnWSx2bsOplnuyNT0+cPFyT5OGDGSvte/q0i+J3MIEI4hat1nK3 X-Received: by 2002:a05:6a00:88f:b0:510:7a49:b72f with SMTP id q15-20020a056a00088f00b005107a49b72fmr25962638pfj.21.1652849019145; Tue, 17 May 2022 21:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849019; cv=none; d=google.com; s=arc-20160816; b=UAnG/rs3lJyjOoMTzVcs4Tu2qUHL3LfCPhBO8Nn5newZHDMOU/E+jdNunRPr8DEu75 /LRY/dNq/q7QAr9V9a55ZD0OBuPbJNYWgnyqAX9ZF8FpcwzCQRVXBBSJJsslxuw8BzpY ekTxx3EXP2wbSiaJRxM5e50tGViEcysV5ZDZ+FCZ7QefxgRqSrrch1N91hvxlnlKOhtm 21LhPHAcaqmqiaL+n/gHRpvoQ1vLC472dNJuEs/X7JpO4eJX9L22CPYolSWR8RjhGswq eGtoVOr4JBc3FWVGNep4sji7zrK/J0goFAcEFNcih/TQqfGdXgWewRrA58fqVf4lOfUI ftmw== 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=e8+H5lT3JfFcLO5FFtiZpEceGFl5xyFQ7E19VaJaMqQ=; b=cGNmxq5SFTY73nD/1BElKt7D/ssW3UmzTJpSswgZ9xRfzf7PvhPtUWfB6uzjrM+PFP EaRRgvu8vtY6/Oh2BCJYAqqTFUXQ8d/4yPHl2JNMVDsNNV0xfwf/vyVff6UoWGoyKtst FabuykAr07yzxFI4mughfknW71dD6S7iCvA6Hx+5uxsymCxALMsLlzb/G7Vea7ghe3rf SRR4kbNBMbD3BWvIGP5P5YNpS/hNhceFM6HFti7nF0YKbh9yD1qZhfy+IDmeoCZAB3X2 OjJhdaKb5rnxsZ0Me7VgqVHc24xOifGkDbxCdXj1iOfKks+x8kdswj5YMBcDjg2i5X65 hEtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nslXOtGa; 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 37-20020a630e65000000b003ab45d6e88asi1275795pgo.254.2022.05.17.21.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:43:39 -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=nslXOtGa; 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 802DB26557; Tue, 17 May 2022 20:56:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232174AbiEQXy0 (ORCPT + 99 others); Tue, 17 May 2022 19:54:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbiEQXyY (ORCPT ); Tue, 17 May 2022 19:54:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B5747548; Tue, 17 May 2022 16:54:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2A11BB81CFD; Tue, 17 May 2022 23:54:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 887C7C385B8; Tue, 17 May 2022 23:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652831660; bh=B84+lcb6ddsH9wn03po93338LsAH3GQWTK0OpmlsHJc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nslXOtGaVoxikOExgYm3UwMqMXeGdYH+Bvq7uDwNsgwjUxa54+zFgEwsjrNs7oTAf N3JnuKaYjo9HYB/wQudEtx5XBvdC5CWNZmtJcCd7iAEYfKNoymJn74RIyn5rddfj4Y dPOd8pzp5RrYuVCa4gkQiA/tsrjVO6n27T4ujAvuPhO84EXM1TgRtaninGvl2B8HLq Fe9dqJSfWNqJrpVhYu9EtdKOuxF9ARC3LHUCagmHr7A0u2gEVkqWKaVyLBNiKXn8fh ofjNTE6No1yO5XhC/FuTjvrDcId+TyEIZ4XqwaAyOZ+6iRICbkCNOM80Pzmff7kX6D em+xZHkEi3IDg== Date: Tue, 17 May 2022 16:54:19 -0700 From: Jakub Kicinski To: Stephen Hemminger Cc: Jonathan Toppins , netdev@vger.kernel.org, Jay Vosburgh , 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: <20220517165419.540f2dc8@kernel.org> In-Reply-To: <20220517154419.44a1cb6a@hermes.local> References: <5a6ba6f14b0fad6d4ba077a5230ee71cbf970934.1652819479.git.jtoppins@redhat.com> <20220517154419.44a1cb6a@hermes.local> 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 15:44:19 -0700 Stephen Hemminger wrote: > On Tue, 17 May 2022 16:31:19 -0400 > Jonathan Toppins wrote: > > > This is an RFC because the current NL_SET_ERR_MSG() macros do not support > > printf like semantics so I rolled my own buffer setting in __bond_opt_set(). > > The issue is I could not quite figure out the life-cycle of the buffer, if > > rtnl lock is held until after the text buffer is copied into the packet > > then we are ok, otherwise, some other type of buffer management scheme will > > be needed as this could result in corrupted error messages when modifying > > multiple bonds. > > Might be better for others in long term if NL_SET_ERR_MSG() had printf like > semantics. Surely this isn't going to be first or last case. > > Then internally, it could print right to the netlink message. Dunno. I think pointing at the bad attr + exposing per-attr netlink parsing policy + a string for a human worked pretty well so far. IMHO printf() is just a knee jerk reaction, especially when converting from netdev_err(). Augmenting structured information is much, much better long term. To me the never ending stream of efforts to improve printk() is a proof that once we let people printf() at will, efforts to contain it will be futile.