From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6DF8341CB5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7707341CB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7q//eWD7kpKVjwkvP9sSwP1duHlI8w+YBBfIBpjcKsU=; b=XOWnbPeHK869eG5NgRyxRRIGBWXGJksAbHxR5YyTn4BIx6+j+VvSQiBjgC3IN9kLM6 AIo37Y0Rc444kkJFPhPJ6euTVgyNThZCA2oJb2LzDS/1SVriuTTi8EvYecyC8eIdiBEA la8iyZFBSWntYG3t4RdeHYi2TDDpBZODccGCEEg9KztzkAhrwpRR4+oZ8vRrEH6hfG1I +R2LKV3N6AglJsS27FLGOe6VHMW4SFpYZRrG1BWdBlBxB0tdFUCbmlrjFalVdDQAPvUE UZjgytkW2zekKT3kN+TYRvzQJK4PsaCiyRzKlKREKYukuda1NuaZ59TM9s4yuM4laT8M VHYw== Date: Fri, 27 Jan 2023 11:22:42 +0200 From: Vladimir Oltean Message-ID: <20230127092242.ajwlo3tivxsjsul7@skbuf> References: <2919eb55e2e9b92265a3ba600afc8137a901ae5f.1674760340.git.leon@kernel.org> <20230126223213.riq6i2gdztwuinwi@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Bridge] [PATCH net-next] netlink: provide an ability to set default extack message List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Romanovsky Cc: Andrew Lunn , Florian Fainelli , netdev@vger.kernel.org, Nikolay Aleksandrov , bridge@lists.linux-foundation.org, Eric Dumazet , Roopa Prabhu , Jakub Kicinski , Paolo Abeni , "David S . Miller" On Fri, Jan 27, 2023 at 07:22:26AM +0200, Leon Romanovsky wrote: > It means changing ALL error unwind places where extack was forwarded > before to subfunctions. > > Places like this: > ret = func(..., extack) > if (ret) { > NL_SET_ERR_MSG_MOD... > return ret; > } > > will need to be changed to something like this: > ret = func(..., extack) > if (ret) { > NL_SET_ERR_MSG_WEAK... > return ret; > } Yeah, but my point is that you inspect the code that you plan to convert, rather than converting it in bulk and inspecting later... > Can we please discuss current code and not over-engineered case which > doesn't exist in the reality? > > Even for your case, I would like to see NL_SET_ERR_MSG_FORCE() to > explicitly say that message will be overwritten. __nla_validate_parse() if (unlikely(rem > 0)) { pr_warn_ratelimited("netlink: %d bytes leftover after parsing attributes in process `%s'.\n", rem, current->comm); NL_SET_ERR_MSG(extack, "bytes leftover after parsing attributes"); if (validate & NL_VALIDATE_TRAILING) return -EINVAL; } return 0; called by nla_validate_deprecated() with validate == NL_VALIDATE_LIBERAL followed by other extack setting in tunnel_key_copy_opts(), which will not overwrite the initial warning message.