Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jan 2021 23:42:46 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Yasuhiro Kimura <yasu@utahime.org>, "kib@FreeBSD.org" <kib@FreeBSD.org>
Cc:        "src-committers@FreeBSD.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@FreeBSD.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@FreeBSD.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: aa8c1f8d84d2 - main - nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write
Message-ID:  <YQXPR0101MB0968C4DAF4A395536C269677DDBF0@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <20210124.050852.1053381322070533315.yasu@utahime.org>
References:  <202101231525.10NFPa3V002367@gitrepo.freebsd.org>, <20210124.050852.1053381322070533315.yasu@utahime.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Yasuhiro Kimura wrote:=0A=
>> The branch main has been updated by kib:=0A=
>>=0A=
>> URL: https://cgit.FreeBSD.org/src/commit/?id=3Daa8c1f8d84d2638a354e71f95=
93e978d00878243=0A=
>>=0A=
>> commit aa8c1f8d84d2638a354e71f9593e978d00878243=0A=
>> Author:     Konstantin Belousov <kib@FreeBSD.org>=0A=
>> AuthorDate: 2021-01-22 21:47:06 +0000=0A=
>> Commit:     Konstantin Belousov <kib@FreeBSD.org>=0A=
>> CommitDate: 2021-01-23 15:24:32 +0000=0A=
>>=0A=
>>     nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcac=
he in nfs_write=0A=
>>=0A=
>>     Otherwise writing thread might wait on sbusy state of the pages whic=
h were=0A=
>>     busied by itself, similarly to nfs_read().  But also we need to clea=
r=0A=
>>     NVNSETSZKSIP flag possibly set by ncl_pager_setsize(), to not undo=
=0A=
>>     extension done by write.=0A=
>>=0A=
>>     Reported by:    bdrewery=0A=
>>     Reviewed by:    rmacklem=0A=
>>     Tested by:      pho=0A=
>>     MFC after:      1 week=0A=
>>     Sponsored by:   The FreeBSD Foundation=0A=
>>     Differential Revision:  https://reviews.freebsd.org/D28306=0A=
>=0A=
>On my 14-CURRENT amd64 environment this commit causes the problem that=0A=
>garbage date are written to file mounted with NFS.=0A=
>=0A=
>I use NFSv4 and autofs to mount home directory on my 12.2-RELEASE=0A=
>amd64 server. And I use zsh as login shell and configure it so command=0A=
>history is written to history file each time any command is executed.=0A=
>=0A=
>After update to 519b64e27fddf10c0b7f6a615edbad730b8c6c45, I see=0A=
>following error message if I try to execute any command.=0A=
>=0A=
>----------------------------------------------------------------------=0A=
>yasu@rolling-vm-freebsd1[1009]% ls=0A=
>zsh: corrupt history file /home/yasu/.zhistory=0A=
>yasu@rolling-vm-freebsd1[1010]%=0A=
>----------------------------------------------------------------------=0A=
>=0A=
>I logged in the server and check the content of history file. Then=0A=
>some garbase data are written to history file.=0A=
>=0A=
>I confirmed the problem disappears by reverting this commit.=0A=
I was also able to reproduce a problem (a truncated file) during=0A=
testing.=0A=
For my case, setting the size to n_size instead of va_size fixed=0A=
the problem I reproduced, but I do not know if this achieves=0A=
what Kostik intended.=0A=
=0A=
My variant of the patch is in D28318.=0A=
Maybe you could test this, although you might want to wait=0A=
until Kostik comments on this variant of the patch.=0A=
=0A=
rick=0A=
=0A=
---=0A=
Yasuhiro Kimura=0A=
=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQXPR0101MB0968C4DAF4A395536C269677DDBF0>