From owner-dev-commits-src-all@freebsd.org Sat Jan 23 20:29:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 441F74DD241; Sat, 23 Jan 2021 20:29:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DNSRG00x3z4vMY; Sat, 23 Jan 2021 20:29:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 10NKTb8B054021 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 23 Jan 2021 22:29:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 10NKTb8B054021 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 10NKTaJv054020; Sat, 23 Jan 2021 22:29:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Jan 2021 22:29:36 +0200 From: Konstantin Belousov To: Yasuhiro Kimura Cc: dev-commits-src-all@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: References: <202101231525.10NFPa3V002367@gitrepo.freebsd.org> <20210124.050852.1053381322070533315.yasu@utahime.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210124.050852.1053381322070533315.yasu@utahime.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4DNSRG00x3z4vMY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2021 20:29:46 -0000 On Sun, Jan 24, 2021 at 05:08:52AM +0900, Yasuhiro Kimura wrote: > From: Konstantin Belousov > Subject: git: aa8c1f8d84d2 - main - nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write > Date: Sat, 23 Jan 2021 15:25:36 GMT > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=aa8c1f8d84d2638a354e71f9593e978d00878243 > > > > commit aa8c1f8d84d2638a354e71f9593e978d00878243 > > Author: Konstantin Belousov > > AuthorDate: 2021-01-22 21:47:06 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2021-01-23 15:24:32 +0000 > > > > nfs client: block vnode_pager_setsize() calls from nfscl_loadattrcache in nfs_write > > > > Otherwise writing thread might wait on sbusy state of the pages which were > > busied by itself, similarly to nfs_read(). But also we need to clear > > NVNSETSZKSIP flag possibly set by ncl_pager_setsize(), to not undo > > extension done by write. > > > > Reported by: bdrewery > > Reviewed by: rmacklem > > Tested by: pho > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D28306 > > On my 14-CURRENT amd64 environment this commit causes the problem that > garbage date are written to file mounted with NFS. > > I use NFSv4 and autofs to mount home directory on my 12.2-RELEASE > amd64 server. And I use zsh as login shell and configure it so command > history is written to history file each time any command is executed. > > After update to 519b64e27fddf10c0b7f6a615edbad730b8c6c45, I see > following error message if I try to execute any command. > > ---------------------------------------------------------------------- > yasu@rolling-vm-freebsd1[1009]% ls > zsh: corrupt history file /home/yasu/.zhistory > yasu@rolling-vm-freebsd1[1010]% > ---------------------------------------------------------------------- > > I logged in the server and check the content of history file. Then > some garbase data are written to history file. > > I confirmed the problem disappears by reverting this commit. Try this. Does the problem disappear with the following patch applied? diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 7d0ff0abff3d..ba72c728ca1e 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1286,11 +1286,11 @@ ncl_write(struct vop_write_args *ap) out: curthread_pflags2_restore(save2); - if ((curthread->td_pflags2 & TDP2_SBPAGES) == 0) { +/* if ((curthread->td_pflags2 & TDP2_SBPAGES) == 0) { NFSLOCKNODE(np); ncl_pager_setsize(vp, NULL); } - +*/ return (error); }