The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: David Howells <dhowells@redhat.com>, Barret Rhoden <brho@google.com>
Cc: Eric Van Hensbergen <ericvh@kernel.org>,
	Latchesar Ionkov <lucho@ionkov.net>,
	Christian Schoenebeck <linux_oss@crudebyte.com>,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 9p: treat read return values of 0 as EOF
Date: Fri, 3 Jul 2026 23:28:41 +0900	[thread overview]
Message-ID: <akfHGcqke9qixd3Q@codewreck.org> (raw)
In-Reply-To: <20260702090941.1298188-1-brho@google.com>

Barret Rhoden wrote on Thu, Jul 02, 2026 at 09:09:32AM +0000:
> If your 9p server shares a synthetic file system such as sysfs, the file
> size from stat often disagrees with the actual file size.
> 
> Treat non-error reads of 0 as EOF, except in the case where the request
> was for 0 bytes.

> Tested:
> 	git@github.com:hugelgupf/p9.git, served "/" on 10.0.2.2
> 
> 	bash-5.3# mount -t 9p -o trans=tcp,port=12345,cache=none 10.0.2.2 /tmp/foo
> 	bash-5.3# cat /tmp/foo/sys/devices/system/cpu/online
> 	0-47

David,
that looks like something that should be handled in netfs - is it right
to do this on the 9p side?

I've just tried with qemu and with cache=none I get ENODATA, with
cache=loose I get the data followed by 4094 zeroes...

Interestingly there also are files with 0 size e.g.
/sys/devices/virtual/net/br0/brforward,
and for this one with cache=none I can read it fine, but with
cache=loose I get an empty file.


Barret,
thanks for the patch, please give us a bit of time to check; I'm
sometimes slow to reply (like for your sending the patch first without
the [PATCH] tag in subject) but I did see it, just hard to find time to
review...

Cheers,
-- 
Dominique

      reply	other threads:[~2026-07-03 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  9:09 [PATCH] 9p: treat read return values of 0 as EOF Barret Rhoden
2026-07-03 14:28 ` 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=akfHGcqke9qixd3Q@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=brho@google.com \
    --cc=dhowells@redhat.com \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --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