- Debugger: Getting mixed signals
- 'Packaging Infrastructure' Contract Weekly Report #4
- Haiku monthly activity report - 06/2015
- 'Packaging Infrastructure' Contract Weekly Report #3
- 'Packaging Infrastructure' Contract Weekly Report #2
- GCI 2014 winners trip report (mentor side)
- TeX Live and LyX; Changes to the boot code
- 'Packaging Infrastructure' Contract Weekly Report #1
- Beginning of 'Packaging Infrastructure' Contract
- Haiku monthly activity report - 05/2015
NFSv4 client: community bonding report
During community bonding period, apart from reading specifications, I also analyzed other NFSv4 client implementations, looking for interesting ideas and solutions. One thing I noticed which may be worth using in my NFSv4 client implementation is caching of some parts of generated RPC request.
In addition to that I also got more familiar with what Haiku expects from file system modules. I have written a very simple dummy file system and check how things work. The problem I encountered here is that Haiku when creating a vnode identifies the file using its inode number. NFSv4 server provides its clients inode numbers but does not provide any way to get file using its inode number. That is why the client will have to keep some cache of inode numbers it is aware of in order to map them to NFSv4 file handles. Self-balancing BST seems to be a good idea.
I started working a few days before May 21st and the day the official coding started I already had a module that was able to generate and send NFSv4 null request and receive a reply using either TCP or UDP as transport protocol. In the first weekend I polished that code, added proper error handling, interpret RPC errors that might happen, made the client use only one TCP connection or UDP socket per server no matter how many file systems are mounted and added support for AUTH_SYS authentication flavor. Public backup of my work is available here.
Since most of RPC and XDR code is complete (apart from few issues I need to address) my next goal is to write NFSv4 request generation and reply interpretation. That will allow me to start writing hooks a FS module should provide. According to my initial timeline I had to have all mandatory hooks written by June 25th. However, now I think there is a big chance I will have that done by June 11th (quarter term).
- Paweł Dziepak's blog
- Login or register to post comments

Comments
Re: NFSv4 client: community bonding report
Nie ma jak Polak programista. Brawo Rodaku! Ufam, że pchniesz Haiku mocno do przodu... :)
Forgive me all non Polish speaking readers. I just said great job and thank you to my country fellow.
Re: NFSv4 client: community bonding report
Oops! Fatygant, I accidentally deleted your website account, while pruning other spam accounts. Sorry about that. :|
Re: NFSv4 client: community bonding report
No problem! I have just recreated it! :)
Re: NFSv4 client: community bonding report
Fantastic! I'm very excited about your project, as the lack of network file share access has been the only thing keeping me from using Haiku as a primary OS at home.
Re: NFSv4 client: community bonding report
Nice progress.
Just a suggestion: you don't need to use ksocket/ksend/k* variants of socket.h API, it's not necessary anymore as these calls are available directly both from user and kernel space.
Historically, this was introduced to help porting/sharing kernel networking file systems code between Haiku, BeOS and/or Zeta.
This not needed anymore, and keep using it will make the code less simple to read and understand for no reason.
Otherway, do you plan to support old NFS version too, and if yes, how is it easy or not?
Re: NFSv4 client: community bonding report
Thank you for your suggestion. I have already pushed updated code to my repo.
The priority of my project is to implement NFSv4 with proper caching, support for delegation, etc. Actually these areas are the biggest differences between NFSv4 and the older versions. The other huge difference is that NFSv4 is no longer a stateless protocol. Finally, NFSv4 does not require additional MOUNT and NLM protocols that were used by NFSv3.
I do not plan to take any steps towards implementing older versions of NFS until NFSv4 client is complete. However, RPC and XDR code is written in such way to make it independent from the upper level protocol so that it can be easily reused in NFSv3 client (and in fact in implementation of any RPC based protocol).