"NFS append race"

Konstantin Belousov kostikbel at gmail.com
Thu May 17 17:39:20 UTC 2018


On Thu, May 17, 2018 at 11:45:45AM -0400, Ryan Stone wrote:
> Do you have a patch you can try, or some pointers as to where to fix
> it and how?  I'm not very familiar with NFS or VFS but I could give it
> a shot.

No, I do not have patches.

You might take a look at the calls to ncl_asyncio() and the
ncl_asyncio() code itself. It does BUF_KERNPROC() to get rid of the lock
ownership for the buffer lock, essentially the lock is not a lock but
semaphore. Then the io occurs in the context of the nfsiod thread.

Vnode lock is not transferred to the nfsiod thread, and since it typically
needs to access the nfs node, things are somewhat messy.

Note that comparing with the local filesystems, after the buffer logical
block number b_lblkno is translated to the device physical block number
b_blkno, buffer completion typically does not require interaction with
the vnode, so BUF_KERNPROC() is more sane there.


More information about the freebsd-fs mailing list