Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2350795rdb; Tue, 10 Oct 2023 00:52:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4w8D1ITMStKY/F3EcHvwHlaPtqCvJr8kPlS9tUGk7DL0u1OsyVamSJglLs0aeY6fGdM9G X-Received: by 2002:a17:90b:110a:b0:27c:eb84:39af with SMTP id gi10-20020a17090b110a00b0027ceb8439afmr769166pjb.43.1696924326021; Tue, 10 Oct 2023 00:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696924326; cv=none; d=google.com; s=arc-20160816; b=zzaEBuHVtXrcr6NpVnIXzHbso4Xhm2aJ8SICgb16fKvrEg+4DfnIA3Vds5y0h+IH8E sQjYTsm2r8c95EzQQE6Afj0FpbcHQ35S/NUpZ8ATYW3Jvlb6oDNyp4pmm7xhz2GAQXEo N67Uwfg5qydvpbME9oHmoBiPl5+upVmvN+i8mmvV1IVyeu71a76LTSgQkNg4su/IS419 yLd8FIUp4L3dPcITFveGmP/cxqRik5eZT6k8eHbS0aVI0d3/5wjKhQHVzzrvXto2skYu mkBXcnBJZI7a3sSTNsFEujmLiA20L2miJvI5taa9uTPRCqHna/G9xyXFTiw6chveJAcB 3R8A== 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:date:dkim-signature; bh=kJcWNo/8KJ51ax88QJfvPgCGs+4edXiaLsPmHPPvA7A=; fh=FhtPJdoTOYq8PYvr7XawU4TZMSIyCfDND0+H8dASkRI=; b=hWkvz3KMIVoQBkjB+uCzXohXqVuYnyeS5TcPvmfpSj06Hwd+ijRe4fHeJ+4gBHtOFR DL86ISYWAfAcAfXLUTv6UzH2X/dqDqAMXq0Z7R3AQn189khpI2vE94ftW5zf6ry6bO+B ZkH9uAVKKXAi4rBbFnFJrZ7qQyWAzumH6kZ/KF9G0zE0uhLxYziUNP+8o2TVJiqYMXf6 7tM1X4VFntEYG/zP45538W2PRVzQ6qn25Ex3HIEQlYgiMBberYzDm/SHRRAQxXp4iN6l CRV2J/+pVgolH3lkrNl2BpYEPMkxFa4sZaH/acgdSpNnlvnjZqhKttsZCZID6IIBp4cp eYFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rxzLlnzd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id gv24-20020a17090b11d800b0026f9b5fe711si13092029pjb.108.2023.10.10.00.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 00:52:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rxzLlnzd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7EB248026493; Tue, 10 Oct 2023 00:52:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442602AbjJJHvm (ORCPT + 99 others); Tue, 10 Oct 2023 03:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442608AbjJJHvk (ORCPT ); Tue, 10 Oct 2023 03:51:40 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED2CEA4 for ; Tue, 10 Oct 2023 00:51:37 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50305abe5f0so7148495e87.2 for ; Tue, 10 Oct 2023 00:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696924296; x=1697529096; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=kJcWNo/8KJ51ax88QJfvPgCGs+4edXiaLsPmHPPvA7A=; b=rxzLlnzdrOcrTACjsMQJyAj7l6DvY/sEcCTADMfB/lU2ew2mcYnLeLwBad7E6zT2Jp PVwP55Wbp6vUac0W65EDo2dmYjbDz19oS26XHOgpSkDblNChOG8vq4943vjhv7sjMxnA ELxihkV1YlyV0bDdPx4r3bJPIALJ2GDikshC7iTqLnhUbkkyeZwGsvsnWeeTj/96G2Xm vQ26hO0Q558ut4GZs4dkvzqgZvQzTj0Om36p88jEmZzV+rxRzBixAT8N2/nMW4+pw/fL 4fwiHEhSzcW5cZSeXGeCDC/fUzCzIrvSNo+s54quaHVTsKRNCMjOhaOWsADbBJi3/eSm UR0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696924296; x=1697529096; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kJcWNo/8KJ51ax88QJfvPgCGs+4edXiaLsPmHPPvA7A=; b=iUa3Auqzch8uyIvzgpRiFzu2dfbnj8MY46LIfO8BDNXwBvFPcXNFIwyNFpky9//iZa 7GU3KAfJ5pvizjTZXT1Y1xeLMvYpsj7doK/cfrX1gjuQRlsEeTyExlQUPxMzVQ7x5N9J ulRhWUoBt4smtm4GB9Ut2xo6qTKclCd0+8wA93tYDkgFGTZO/jUoFJEsSOG9YDuLd8vQ LOpbgSilKXxtfi3q5upawaYWlNH/HgQUsuNy1wAEcPwXl6CaxTQQQ9LDLwPe8QGUAh+E jOcyRRxh71zqInVTjFbKc8Ku6zorr8LEyorKbPjFHAswJCrP1MpufZTtNTJcNwDfG+bl +XSg== X-Gm-Message-State: AOJu0YyvfsEI5Ueaf7T+On/bw5UhVX5J90FdOFkS5AjjCdb4CQYjqm9k 70gya0VDROylhls2Xt0dEUpzsA== X-Received: by 2002:a05:6512:60f:b0:4fe:94a1:da84 with SMTP id b15-20020a056512060f00b004fe94a1da84mr13917473lfe.5.1696924296104; Tue, 10 Oct 2023 00:51:36 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c3b9000b0040684abb623sm15716967wms.24.2023.10.10.00.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 00:51:35 -0700 (PDT) Date: Tue, 10 Oct 2023 10:51:32 +0300 From: Dan Carpenter To: Su Hui Cc: ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fs/9p/xattr.c: avoid format-overflow warning Message-ID: <56aa4f09-8f61-48f3-9836-687bf852b03a@kadam.mountain> References: <20231008060138.517057-1-suhui@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231008060138.517057-1-suhui@nfschina.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 00:52:03 -0700 (PDT) X-Spam-Level: ** On Sun, Oct 08, 2023 at 02:01:39PM +0800, Su Hui wrote: > with gcc and W=1 option, there's a warning like this: > > In file included from fs/9p/xattr.c:12: > In function ‘v9fs_xattr_get’, > inlined from ‘v9fs_listxattr’ at fs/9p/xattr.c:142:9: > include/net/9p/9p.h:55:2: error: ‘%s’ directive argument is null > [-Werror=format-overflow=] > 55 | _p9_debug(level, __func__, fmt, ##__VA_ARGS__) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > use "" replace NULL to silence this warning. > > Signed-off-by: Su Hui > --- > fs/9p/xattr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c > index e00cf8109b3f..d995ee080835 100644 > --- a/fs/9p/xattr.c > +++ b/fs/9p/xattr.c > @@ -139,7 +139,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, > > ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) > { > - return v9fs_xattr_get(dentry, NULL, buffer, buffer_size); > + return v9fs_xattr_get(dentry, "", buffer, buffer_size); I'm pretty uncomfortable with this patch... This code is 13 years old so it can't be too huge of a problem. We're doing this for the printks, but now they're going to look weird first of all. Old: "file = (null)" New: "file = " But also this must have some other effects on runtime right? regards, dan carpenter