Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2362830rdb; Tue, 10 Oct 2023 01:21:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPKXo9Cs2Py97eciGN5Lth3oqRMTpXbwfd20fTKRgVrye0KswFw3D+psWca+OQPMpPxpTn X-Received: by 2002:a05:6a20:6a0a:b0:15f:b5:bfee with SMTP id p10-20020a056a206a0a00b0015f00b5bfeemr18985183pzk.5.1696926091616; Tue, 10 Oct 2023 01:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696926091; cv=none; d=google.com; s=arc-20160816; b=x1gaynG2ySziisbvfjclQ0j/6Gu90RYv76VYoSgn8FYB9ih3R4cSlquAe6HEaN12TZ 505gaw8JzVBI0lK3jQDLiyA5iZ16f3ifn7khucaEC7iTI3kP/ouatAYZuMj9/tFLl5Zd GCwMq3dhDmxW9A69SXW/ipLG5kI5oLF6oIaGu0tKcHmChFcF7aNtqG5v6mLwy6u0Uipa kJHyZeQVMZaxUTGcdS5aGyyz9ANoIAs0tvCwvKsMVjriP7h1AKgbMDqmnIgsCwscK6sv +aYF5nFjpPToHQ0kGaE1dXMpDlxL5WIqNdtREr/ZWx44q+fFIMoNVlaDUOAD2sTbQ+bj 7O3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=sXc++gr0rQvRsFpEsJMXS00BUkEq6gxSIJxKtXTXndA=; fh=k2tkDuEBBCOy4y4ooUjooVuBMiod23Xqn2EFv8v2lZ0=; b=q7WNVZaeDi0mR2lA1TSkki4iiU80+0YqkZE/taYxOwVVRPnIifLmJHkdc4HzSKa0Qz WkRxCE3ha5QinWei2ZYephE+35mmIEhpeIyz1O4DI1UCstFF+TJp+M4cq0gIdkEQd3mj ldnXsqGC7xlji/JrucwE4nxPuVbIcQBWUb3YF2LCAuvPCjEzLGP0fz1AFF1LKjparP4l g1TVHkbhVeKrouIExcwH1i5T3F1v5+YwmvxHTRNsrJKl4U1RVKHcUwcpfW4bGRrHcCCN LRchTK4WN/v8nJ5mkaQUsugvLUv6aokdLmcbHenFlSTzD38UkW/+4lcSgh+R1GllIW+j sU/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id x13-20020a170902ec8d00b001c36018fdaasi540674plg.219.2023.10.10.01.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:21: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; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BD15F808E646; Tue, 10 Oct 2023 01:20:30 -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 S1442801AbjJJIUB (ORCPT + 99 others); Tue, 10 Oct 2023 04:20:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442750AbjJJITl (ORCPT ); Tue, 10 Oct 2023 04:19:41 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 2583CB4; Tue, 10 Oct 2023 01:19:37 -0700 (PDT) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 8FB1D60637837; Tue, 10 Oct 2023 16:19:33 +0800 (CST) Message-ID: Date: Tue, 10 Oct 2023 16:19:32 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] fs/9p/xattr.c: avoid format-overflow warning Content-Language: en-US To: Dan Carpenter 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 X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui In-Reply-To: <56aa4f09-8f61-48f3-9836-687bf852b03a@kadam.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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, 10 Oct 2023 01:20:31 -0700 (PDT) X-Spam-Level: ** On 2023/10/10 15:51, Dan Carpenter wrote: > 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 = " Agreed, this looks  really weird and the patch is just for avoiding gcc's warning. Sorry for the noise. Su Hui > > But also this must have some other effects on runtime right? > > regards, > dan carpenter >