Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2017 20:47:53 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Rick Macklem <rmacklem@uoguelph.ca>, Ian Lepore <ian@FreeBSD.org>, Gergely Czuczy <gergely.czuczy@harmless.hu>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: process killed: text file modification
Message-ID:  <D0770019-3EEA-45D2-A751-18DF1B274F90@FreeBSD.org>
In-Reply-To: <20170317141917.GS16105@kib.kiev.ua>
References:  <45436522-77df-f894-0569-737a6a74958f@harmless.hu> <55189643.aaZPuY77s8@ralph.baldwin.cx> <3ed3e4a3-23af-7267-39f1-9090093c9c1e@harmless.hu> <5ac94b9a-7ced-9eff-d746-7dddaaeca516@harmless.hu> <1489340839.40576.82.camel@freebsd.org> <FF55DB37-4A6B-4D88-B201-B3BCA1A11E87@FreeBSD.org> <YTXPR01MB01898D49933A82170FCAB7A0DD390@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> <YTXPR01MB018944EF4248402AD421D825DD390@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> <20170317083605.GQ16105@kib.kiev.ua> <YTXPR01MB0189F7147A7C5C5F8C56B2F1DD390@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM> <20170317141917.GS16105@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_8A484A28-704E-438B-B7AB-1F5F014DD938
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 17 Mar 2017, at 15:19, Konstantin Belousov <kostikbel@gmail.com> =
wrote:
>=20
> 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().
>=20
> I agree that the patch would not create new dirty buffers, but it is =
possible
> to get them by other means.
>=20
>>=20
>> What the patch was missing was updating n_mtime after the dirty
>> page flush.
>>=20
>> 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.
>>=20
>> 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=3D3 on both server and
client.

-Dimitry


--Apple-Mail=_8A484A28-704E-438B-B7AB-1F5F014DD938
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.30

iEYEARECAAYFAljMPXEACgkQsF6jCi4glqOi3wCfRpH+RjEYSVN4InJXsFdyUdZc
v2wAn3AD55eetKriKKscKDN1g527zobq
=LD1C
-----END PGP SIGNATURE-----

--Apple-Mail=_8A484A28-704E-438B-B7AB-1F5F014DD938--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D0770019-3EEA-45D2-A751-18DF1B274F90>