On Fri, Mar 17, 2017 at 01:53:46PM +0000, Rick Macklem wrote:
> Well, I don't mind adding ncl_flush(), but it shouldn't be
> necessary. I actually had it in the first
> rendition of the patch, but took it out because it should happen
> on the VOP_CLOSE() if any writing to the buffer cache happened
> and that code hasn't changed in many years.
Dirty pages are flushed by writes, so if we have a set of dirty pages and
async vm_object_page_clean() is called on the vnode' vm_object, we get
a bunch of delayed-write AKA dirty buffers.  This is possible even after
VOP_CLOSE() was done, e.g. by syncer performing regular run involving

I agree that the patch would not create new dirty buffers, but it is possible
to get them by other means.

> What the patch was missing was updating n_mtime after the dirty
> page flush.
> Btw, a flush without OBJPC_SYNC happens when the file is VOP_CLOSE()'d
> unless the default value of vfs.nfs.clean_[ages_on_close is changed, which
> I think is why the 1sec resolution always seemed to work, at least for the
> example where there was an munmap before close.
> Attached is an updated version with that in it, rick
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to