All of lore.kernel.org
 help / color / mirror / Atom feed
From: asmadeus@codewreck.org
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: ericvh@kernel.org, lucho@ionkov.net, Su Hui <suhui@nfschina.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
Date: Tue, 10 Oct 2023 11:23:06 +0900	[thread overview]
Message-ID: <ZSS1irFMxC35cg01@codewreck.org> (raw)
In-Reply-To: <13910281.Zj71IQSfG8@silver>

Christian Schoenebeck wrote on Mon, Oct 09, 2023 at 08:34:15PM +0200:
> > +++ 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?
> 
> 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.

p9pdu_vwritef should output the same (just a 0 length) for both NULL and
"" so I think it should be ok, but it definitely needs testing.

I'll try to find time to check (getfattr -d should be enough) later this
week and add it to the pile

-- 
Dominique Martinet | Asmadeus

  parent reply	other threads:[~2023-10-10  2:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08  6:01 [PATCH] fs/9p/xattr.c: avoid format-overflow warning Su Hui
2023-10-09 18:34 ` Christian Schoenebeck
2023-10-10  1:20   ` Su Hui
2023-10-10  2:23   ` asmadeus [this message]
2023-10-10  7:59     ` Christian Schoenebeck
2023-10-10  7:51 ` Dan Carpenter
2023-10-10  8:19   ` Su Hui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSS1irFMxC35cg01@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=suhui@nfschina.com \
    --cc=v9fs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.