public inbox for v9fs@lists.linux.dev
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: Eric Van Hensbergen <ericvh@kernel.org>,
	Latchesar Ionkov <lucho@ionkov.net>,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org,
	Robert Morris <rtm@mit.edu>
Subject: Re: [PATCH v2] 9p/net: fix improper handling of bogus negative read/write replies
Date: Wed, 19 Mar 2025 18:42:42 +0900	[thread overview]
Message-ID: <Z9qRkkLhFOK7Pl2F@codewreck.org> (raw)
In-Reply-To: <2056162.6bbq6Mt1IA@silver>

Christian Schoenebeck wrote on Wed, Mar 19, 2025 at 10:20:05AM +0100:
> > -		p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d (/%d)\n",
> > +		p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %zu (/%zu)\n",
> >  			 fid->fid, offset, rsize, count);
> 
>   p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %u (/%zu)\n",
>            fid->fid, offset, rsize, count);
> >  		if (rsize < written) {
> > -			pr_err("bogus RWRITE count (%d > %d)\n", written, rsize);
> > +			pr_err("bogus RWRITE count (%u > %zu)\n", written, rsize);
> 
>   pr_err("bogus RWRITE count (%u > %u)\n", written, rsize);

(Right, got these two as they cause a warning with W=1)

> >  int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
> >  {
> > -	int err, rsize, non_zc = 0;
> > +	int err, non_zc = 0;
> > +	u32 rsize;
> >  	struct p9_client *clnt;
> >  	struct p9_req_t *req;
> >  	char *dataptr;
> 
> Missing change for:
> 
>   p9_debug(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %u",
>            fid->fid, offset, count);

Oh, this one doesn't seem to cause a warning.
I guess it doesn't matter much unless we get something > 2^31 but might
as well fix, sending as a v2

-- 
Dominique

      reply	other threads:[~2025-03-19  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-16 21:32 [PATCH v2] 9p/net: fix improper handling of bogus negative read/write replies Dominique Martinet
2025-03-16 21:38 ` Dominique Martinet
2025-03-19  9:20 ` Christian Schoenebeck
2025-03-19  9:42   ` Dominique Martinet [this message]

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=Z9qRkkLhFOK7Pl2F@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=rtm@mit.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox