Date: Thu, 17 May 2018 20:39:04 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Ryan Stone <rysto32@gmail.com> Cc: "freebsd-fs@freebsd.org" <fs@freebsd.org> Subject: Re: "NFS append race" Message-ID: <20180517173904.GR6887@kib.kiev.ua> In-Reply-To: <CAFMmRNx3comXotENFtsGs%2BGhOV=aFUBJM36nhTwsTc_Qyb5X2g@mail.gmail.com> References: <CAFMmRNy%2Bk1swbmQRWWs_wsACcM7EkLKQS9dtfikzFCH3pXSQaA@mail.gmail.com> <20180513184120.GY6887@kib.kiev.ua> <CAFMmRNx3comXotENFtsGs%2BGhOV=aFUBJM36nhTwsTc_Qyb5X2g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180517173904.GR6887>