linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Client support for 0-length virtual files
@ 2024-02-27 13:04 Atkinson, Sam
  2024-02-27 13:56 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Atkinson, Sam @ 2024-02-27 13:04 UTC (permalink / raw)
  To: linux-nfs@vger.kernel.org

Hello, I am looking for thoughts/guidance on exposing 0-byte virtual files (implemented with seq_file) over NFS. 

I have had success exposing these 0-byte files with nfsd and reading the files from a client with third-party userspace clients (https://github.com/CharmingYang0/NfsClient specifically), but I am hitting a roadblock with the Linux NFS client. When the file size is 0, the client seems to give up and return from the syscall before making a read request to the server, even when an application explicitly issues a syscall with a non-zero length (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs/nfs/read.c?h=v5.10.210#n125). 

As far as I can see, there is nothing in the NFS spec indicating that clients should behave in this way. But I realize that making any change in this behavior could introduce additional round-trips whenever the client thinks the file length is shorter than the server. Could anyone share context or thoughts on why this is the behavior in the Linux NFS client and/or thoughts on paths forward? Would folks here entertain a patch proposal which removes said behavior, maybe configurable with a client-side module param or control file?

Thanks very much,
Sam



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-27 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27 13:04 Client support for 0-length virtual files Atkinson, Sam
2024-02-27 13:56 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).