Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1193318rdb; Wed, 20 Sep 2023 02:14:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzY+KhomS0eBFhmLb7amD1DFNuYxLpdNq5kOQ1b/rf3/g+6GOYxyoSKC+LMoR9WfDaK8gW X-Received: by 2002:a05:6a00:1828:b0:68a:69ba:6789 with SMTP id y40-20020a056a00182800b0068a69ba6789mr2649922pfa.16.1695201271093; Wed, 20 Sep 2023 02:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695201271; cv=none; d=google.com; s=arc-20160816; b=VWJJGSy0d+PViMRvHRx/Dcx2N5GGtjn22OG0xuXhDVHyCN/7PD5V5ioB2Icb9o8Cwq wvCIsNjfUzoefBCga46DlhK159STAXS6MmriIf3HmWp+XPd7qGrE7BNf46Ovskc3cFZN jYalLI97OUF6fhJ/Q0uTj6QXy8gMybOe3GbEfBE+n7V5KvDAzYLoPXGaas3Qvw4b8maM vLaLXUkMTUc1BeK1/HLFypllmc5AFL0vMrDI2/3jyh7iY9+l6Va0fnaiKUHrzFbr7lHt stKCLT7LmzSP2/F7syy1LooUFhBIBjYEDl6nPk6BtzLpyU9+JG/3X8rOC0G3FsOiUw5C mD1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=kaQ4quY2FOsV6dNr0SfZBxe3SAq2X9fKDNK/mTJUPJo=; fh=QlPQTDiUXlEBUVsLubp5sa1HfmxIc7/7f2wx9fAzjEI=; b=Iqx0lXkoiBCrP4fZ+wUD3slAGdpN8ie6/BimpAukUjRuyDiZN17fe/g54nqJZ+LkJD jMu15nDA312CpY0Q/k7+cQkAOT8MmB0N7kEqR6g6Mc8VTI1/9IAFz/NIkLZg6sOqZVGF IJk3r3cQtPT2PlFd/uz23LdUYc23qNIgkXGYAYHT8CmQIGHoQuZp7m6SHmggbOxUkTep ZdC2YJXHzdf7CMgAnxMTJtdvGj4HPMyfitvxvDnOIE5fZfdgZuc2SSUOZ4ngj4gHR7g8 QBD3d3hyPqwgBAX2lUB+o+9k5k7m+5UwUoZn9coIOYtQkPEsFTJerTpOxQ3ZVj84NIdm E9og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fcDGTbVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cp21-20020a056a00349500b0068ffeb6a949si11144267pfb.73.2023.09.20.02.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 02:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fcDGTbVM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A2ACC8289535; Tue, 19 Sep 2023 17:39:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231660AbjITAjA (ORCPT + 99 others); Tue, 19 Sep 2023 20:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230447AbjITAi7 (ORCPT ); Tue, 19 Sep 2023 20:38:59 -0400 Received: from out-217.mta1.migadu.com (out-217.mta1.migadu.com [95.215.58.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E0F3AD for ; Tue, 19 Sep 2023 17:38:53 -0700 (PDT) Date: Tue, 19 Sep 2023 20:38:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1695170331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaQ4quY2FOsV6dNr0SfZBxe3SAq2X9fKDNK/mTJUPJo=; b=fcDGTbVMFIQBEQQkC1wwEadLsMgzFYjQD45cjxVUPdUiWnXP7BAGG2BBy9HL98dl1VVqv8 MrbxQqzERfO5k8wwlYNRmfFUpUB/liPIKJRtQ+IXJZCPp6TRaP2iiSJG8RAaSd6ifLb7yc vSjQ5g13+izc5myuYNdH/3DYZgCA+AA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Christophe JAILLET Cc: Brian Foster , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: Re: [PATCH] bcachefs: Use snprintf() instead of scnprintf() when appropriate Message-ID: <20230920003847.nus6l45zqhv5hseb@moria.home.lan> References: <9a998be3e2dbedcd3a9eae5f81ae6dcc6c0f98c4.1694849375.git.christophe.jaillet@wanadoo.fr> <20230919190234.2k7v75htqlbfqofh@moria.home.lan> <011234f5-19f3-21c5-f0cf-8027971397e7@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <011234f5-19f3-21c5-f0cf-8027971397e7@wanadoo.fr> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 17:39:01 -0700 (PDT) On Tue, Sep 19, 2023 at 09:23:47PM +0200, Christophe JAILLET wrote: > Le 19/09/2023 à 21:02, Kent Overstreet a écrit : > > On Tue, Sep 19, 2023 at 09:17:27AM -0400, Brian Foster wrote: > > > On Sat, Sep 16, 2023 at 09:30:19AM +0200, Christophe JAILLET wrote: > > > > snprintf() and scnprintf() are the same, except for the returned value. > > > > When this value is not used, it is more logical to use snprintf() which is > > > > slightly simpler. > > > > > > > > Signed-off-by: Christophe JAILLET > > > > --- > > > > > > Seems reasonable: > > > > > > Reviewed-by: Brian Foster > > > > No, let's stay with scnprintf as the default - snprintf should be > > deprecated except for when its return value is actually needed, using it > > incorrectly has been a source of buffer overruns in the past. > > > > Ok, I was not aware of it. > > In this case, there are also some s/snprintf/scnprintf/ opportunities in > fs/bcachefs > > Does it make sense to update them or is it too low value changes? Not terribly important - long term, I want to depracate both snprintf and scnprintf and convert everything to printbufs.