Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2074858rdb; Mon, 9 Oct 2023 11:35:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3KnwkgQmddOb9kbV9Sk70QV9SCpZuCILBllb7xAz2jelQKw9HzfjnFIKL9JJbwJ2aIEcs X-Received: by 2002:a17:90b:4c07:b0:262:d661:2963 with SMTP id na7-20020a17090b4c0700b00262d6612963mr12864352pjb.39.1696876545260; Mon, 09 Oct 2023 11:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876545; cv=none; d=google.com; s=arc-20160816; b=A1TqLDWdNlLolpB5Kz8yV4dnX/BCBp7ehh7yy3eftgGrkYCA+GRUNE959fL0Hl7EHB +epNPRQXhSNDj7KxDLh1HIC1A0qFuAbBstP5rcMpt4jJOzkJpHO+KiBOpphNALJvatFT 9dgliVNrLtpBWWpidOyLNMp+U76cN+hQcnEewlGoN+mq39p/+GGsqkw6mvOuVAuQWd8g K4KgF/h5liug279boin/xP0eL1AuRX+1m/pNpJLg6YbYXmA8JrL0+HbE7Vnh/jtxv/Ff hoQPrfmA/+S30AyLCTmYO8fV8TbMiKJfMryl0Ho5/XpcdvrpbkIWGdGWuwmVovMhs3o1 hP/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y9OH9A/0tZs5gOlE4MHof+N8Nd5EhBnLnFtNiEA9oIc=; fh=MJ3jWZdn807RygqA2BVjdlGVnQa3gv9jIMcZKsykX50=; b=H77eNgvvMV3tGs3ic902eLi08tw8NWs/XH3Ks3xDZJ7pypRl0rAaIV5Oay6n/Fhgwh WgF7yZj4hvua4wmfffMakyGWCxyrnUgxhCYJg0dl/wZJzTKpTpwH5W2zGZKd9xHjninH 91RDEz+2dCKUn0f3iFQbDpeIl9ZZvW4cXlczv/0PFHMIPkt+CnGSjlqEP6bUM+2q4KRt 9B8eO/ybxjADnu54oaiOYt3FdpBp2zxtqBrsr5VzHMmW84VDCwuq7QZI+EyumUCmxTb/ uR3NmrHIeX/3NzKcPb6jtSYS0XZ2uqll5sSpzxyF2GWRKJWbiK033N+vKxIU4gBy/DCH I6Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=aLef17p0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id om9-20020a17090b3a8900b002777ce4c9e6si11030715pjb.72.2023.10.09.11.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:35:45 -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=@crudebyte.com header.s=kylie header.b=aLef17p0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F3BA98077A71; Mon, 9 Oct 2023 11:35:12 -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 S1378219AbjJISfE (ORCPT + 99 others); Mon, 9 Oct 2023 14:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378226AbjJISex (ORCPT ); Mon, 9 Oct 2023 14:34:53 -0400 Received: from kylie.crudebyte.com (kylie.crudebyte.com [5.189.157.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C45DDE for ; Mon, 9 Oct 2023 11:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=y9OH9A/0tZs5gOlE4MHof+N8Nd5EhBnLnFtNiEA9oIc=; b=aLef17p0jWqH/wWV1FQPPbyeuC MU1zujxGipaHUFxeGksF8mYxmwdBUUnJPn8OuuHXUoX3yLii/YWCpZubR3mB7pvIfbSdaJMXYViJK Jz79xMplG9W9I0V62qFurehS7rNMdEFxX3SBX8Gwp1+gsf5ENN2dZxf4SwMm5A+qVaV7sF7RMtyMM zgNswtCDMVMSHQUJgdeYyV9Nt0e2oN+eEikOs4fdcMBkLtsSx/aHIog30jceFrxCkQEsoi6Ro31Hf IU1oDBN7TwCra1qFGC32hKHvYiQBGsVFyfZGv2CZ1nbxK3kbdlYbSnWtA9T5Bg6q+e3RBFaGXgIB3 m3bO/oexi6V/yQEGNGGoAxJRGvJiQOWG3hcmth2qLtPaSYKU2sEnbvoBRWb/YYVZvU5jQq2h4YdSR npbskRosPQeWE9LrAZLEE3M+/6Lo0DcwqzuisnFXLhmJzQ7tClTwjxChFINzhQyhbgc6HdUcfzMCj jOUHvN/bgFM/Z+y7Ofp/oD//V2y/NLnhRZiiXCbYzw3UlsgM+hkfDt7pVnRXHgDZtXteNlczIKCEJ rsYcigSyUTOQC8t8vnb9JoeVIKLlpZ/o1xzK+S2VdJYfgx1T4AvVq1KCu1X8AWn/hlCpMa1+g7Lfl /bkb8I0tpgDwA1s4V6MVXucEMoPQruOphI5iHyar8=; From: Christian Schoenebeck To: ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, Su Hui , v9fs@lists.linux.dev Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fs/9p/xattr.c: avoid format-overflow warning Date: Mon, 09 Oct 2023 20:34:15 +0200 Message-ID: <13910281.Zj71IQSfG8@silver> In-Reply-To: <20231008060138.517057-1-suhui@nfschina.com> References: <20231008060138.517057-1-suhui@nfschina.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 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]); Mon, 09 Oct 2023 11:35:13 -0700 (PDT) X-Spam-Level: ** On Sunday, October 8, 2023 8:01:39 AM CEST Su Hui wrote: > with gcc and W=3D1 option, there's a warning like this: >=20 > In file included from fs/9p/xattr.c:12: > In function =E2=80=98v9fs_xattr_get=E2=80=99, > inlined from =E2=80=98v9fs_listxattr=E2=80=99 at fs/9p/xattr.c:142:9: > include/net/9p/9p.h:55:2: error: =E2=80=98%s=E2=80=99 directive argument = is null > [-Werror=3Dformat-overflow=3D] > 55 | _p9_debug(level, __func__, fmt, ##__VA_ARGS__) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 > use "" replace NULL to silence this warning. >=20 > Signed-off-by: Su Hui > --- > fs/9p/xattr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, > =20 > ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffe= r_size) > { > - return v9fs_xattr_get(dentry, NULL, buffer, buffer_size); > + return v9fs_xattr_get(dentry, "", buffer, buffer_size); > } > =20 > static int v9fs_xattr_handler_get(const struct xattr_handler *handler, >=20 Mmm, that's not the same is it? Have you tested this change? 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 attribut= es. 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. /Christian