Re: process killed: text file modification

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 17 Mar 2017 20:47:53 +0100
On 17 Mar 2017, at 15:19, Konstantin Belousov <kostikbel_at_gmail.com> wrote:
> 
> 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
> vfs_msync().
> 
> 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

FWIW, Rick's patch seems to do the trick, both for my test case and lld
itself.  And even with vfs.timestamp_precision=3 on both server and
client.

-Dimitry


Received on Fri Mar 17 2017 - 18:48:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:10 UTC