I just posted this patch: https://review.gerrithub.io/411347 to address the use of the global fd for getattr/setattr. This has caused concern by various users.

 

I also thought of an API change we could make that could help things. In NFS v4, there will be GETATTR calls after I/O which may have used a stateid, however, the GETATTR itself does not use the stateid. We could still fetch the state_t and have an option of passing that on the GETATTR if available. That would then allow use of the state_t file descriptor instead of opening the temporary file descriptor when we already have a state_t file descriptor that would work just fine for the getattr. That API could also be utilized if I ever get around to coding up a search for lock or share state for NFS v3 I/O.

 

Frank