Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2229787rdb; Mon, 9 Oct 2023 18:20:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjGRujShMlBvS84UTeWduA1qj7y2PQE6i5Bl6pewcU2VmQes+cpb2vLd+tGhWWPc9gFZ0Q X-Received: by 2002:a05:6a21:6d9b:b0:14b:8023:33cb with SMTP id wl27-20020a056a216d9b00b0014b802333cbmr21897947pzb.11.1696900856667; Mon, 09 Oct 2023 18:20:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696900856; cv=none; d=google.com; s=arc-20160816; b=hgx/Ec6KCosXLVifIGrdk1xPzlkDmyQVXHsXjaZdblPnd+14cIpx4R5AVNTs/Db3X0 rTv8ecrte0JOqDqzfTS9QBGIXyYyUyKLTaNKjN3O7e+Ll7dIq6l03KV++PR8+6KNM2jR YKwYPYPTa3u4CbuXYuJJmNlGAKgnZ85SyWr0W9rghp62SyDvq5f2h2gUBKeNxPS20jI5 /Ld1hwjxFLI0jnO2TNfpQnBF36NyfJqMIQzalFmnLjIQSRx7+MAFAyU6ZzjN/vNHgUQe AGxUA5Jdck7gJYXEB7YCHNqDavU0NQJO+QRWPn0WtAM2S2ypGHfuDdDm3rpGBIvmE6n7 9RDA== 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=KTL1L7JfuDxdRAUmN53f+ugh/sCQFYniUEIbHaIMSq8=; fh=htjQl0qn7wgcq281xhUCULWEiKq2nwLPoKVGtqqgjyc=; b=zk4mkOypxZ6sbgaHhKR93Yqf4tiKGOPgZxGrGBY5mqfERdUy4j84xPMrTsKYhxY3a8 dc5xdlFduUsa8xznkpBOCuunPKld3nDxFL8swjXdBQpTH/DeBFHuovfbMVnJyfUWhBq9 jvqMIBC9eNcTXUQ3WO5BzoehnCl6zyW6V/+YEhlj9c1dG39iVLH0KeutmaKF9w8QIu2/ yd4aV753qxffSnJ2l95o42xtbhfvZUH/oGVCTi+bZ92ke9U+ivZf9LkP0YWfGcPCIroX idbVHTN9tBneIRDVIYiiccpy+jP3AD8KM6qvgJTqyvio2TS/MJ5OYydmLdMZ48xDGA5E +sTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id fj11-20020a056a003a0b00b006901c3079c7si8747558pfb.268.2023.10.09.18.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 18:20:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 7EBB38250DDC; Mon, 9 Oct 2023 18:20:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379259AbjJJBUU (ORCPT + 99 others); Mon, 9 Oct 2023 21:20:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379258AbjJJBUT (ORCPT ); Mon, 9 Oct 2023 21:20:19 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 1F9F0DA; Mon, 9 Oct 2023 18:20:16 -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 C0BAE60313E9A; Tue, 10 Oct 2023 09:20:13 +0800 (CST) Message-ID: Date: Tue, 10 Oct 2023 09:20:13 +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: Christian Schoenebeck , ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, v9fs@lists.linux.dev Cc: 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: <13910281.Zj71IQSfG8@silver> 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 18:20:39 -0700 (PDT) X-Spam-Level: ** On 2023/10/10 02:34, Christian Schoenebeck wrote: > On Sunday, October 8, 2023 8:01:39 AM CEST 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); >> } >> >> static int v9fs_xattr_handler_get(const struct xattr_handler *handler, >> > Mmm, that's not the same is it? Have you tested this change? Oh, sorry.  That's not the same and I just tested compilation. > > Currently this function causes a 'Txattrwalk' 9p message to be sent to 9p > server with its name[s] field being NULL, and the latter being the magical > hint to 9p server to not send an attribute, but rather the list of attributes. > > With your change I would assume that it would rather ask server for one > attribute called "". I have not tested myself, just worrying that it might > break behaviour. Got it, I made a mistake there. Thanks for your explanation. Sorry for the noise again. Su Hui