Client support for 0-length virtual files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux