Re: NFS problem found - pleaes try this patch.
On Mon, Jan 18, 1999 at 10:05:50AM -0500, Luoqi Chen wrote: The check is correct and should be there, the B_CACHE bit was cleared because I made a mistake when setting the valid bit in the vm page. [...] Note the calculation of ev, the original code was a round-up and I changed it to round-down in my -r1.188 commit (I thought it was a bug in the original code, but it was actually me who didn't understand the nfs code well enough). The patch seems to solve the problem as nfs behaves as it did prior to -r1.188. Thanks. But there's still something wrong: When shutting down the server it still sometimes panics in vinvalbuf() complaining 'bout dirty pages. On the client side vi dies of SEGV (edited file and /var/tmp/vi.recover on nfs fs) generating a wrong sized recover file. After that the server panics on shutdown. Without triggering the bug it shuts down gracefully. I'll try to receipe a situation for easily reproducing this. Bjoern -- -BEGIN GEEK CODE BLOCK- GCS d--(+) s++: a- C+++(-) UBLOSI$ P+++(-) L+++(-) !E W- N+ o+ K- !w !O !M !V PS++ PE- PGP++ t+++ !5 X++ tv- b+++ D++ G e+ h-- y+ --END GEEK CODE BLOCK-- To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
On Tue, 19 Jan 1999 11:38:50 +0100, Bjoern Fischer wrote: But there's still something wrong: When shutting down the server it still sometimes panics in vinvalbuf() complaining 'bout dirty pages. I'm not sure this has anything to do with NFS. I got this after last night's fresh world and kernel install. The vinvalbuf message occured after the ``syncing disks ...done'' message but before the ``Rebooting'' message and. However, I cannot reproduce the message since that reboot, with or without NFS activity. Ciao, Sheldon. To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
This patch seems to fix my NFS problems. I started a make release yesterday and it is still running (It's a slow machine). No problems so far. The chroot dir is NFSv2/UDP mounted. Thanks, Daniel Luoqi Chen schrieb: The check is correct and should be there, the B_CACHE bit was cleared because I made a mistake when setting the valid bit in the vm page. Index: vfs_bio.c === RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.192 diff -u -r1.192 vfs_bio.c --- vfs_bio.c 1999/01/12 11:59:34 1.192 +++ vfs_bio.c 1999/01/18 14:45:33 @@ -2171,7 +2171,7 @@ (vm_offset_t) (soff PAGE_MASK), (vm_offset_t) (eoff - soff)); sv = (bp-b_offset + bp-b_validoff + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); - ev = (bp-b_offset + bp-b_validend) ~(DEV_BSIZE - 1); + ev = (bp-b_offset + bp-b_validend + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); soff = qmax(sv, soff); eoff = qmin(ev, eoff); } Note the calculation of ev, the original code was a round-up and I changed it to round-down in my -r1.188 commit (I thought it was a bug in the original code, but it was actually me who didn't understand the nfs code well enough). -lq To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
On Tue, Jan 19, 1999 at 01:01:34PM +0200, Sheldon Hearn wrote: [...] But there's still something wrong: When shutting down the server it still sometimes panics in vinvalbuf() complaining 'bout dirty pages. I'm not sure this has anything to do with NFS. I got this after last night's fresh world and kernel install. The vinvalbuf message occured after the ``syncing disks ...done'' message but before the ``Rebooting'' message and. Then why is the panic on the server triggered by the vi SEGV? No vi SEGV - server goes down normally; vi SEGV - server panics on shutdown. However, I cannot reproduce the message since that reboot, with or without NFS activity. It is somewhat tricky. There's actually only one file I've got that causes vi to SEGV (and the server to panic on shutdown). I'll have to look into vi source to find out how the vi.recover file is created. Maybe some locking is involvled, too. Bjoern -- (sig_t*)NULL To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
Good work! I have to run at the moment but it looks like you nailed this one. Your explanation coincides perfectly with the symptoms. Thanks! -Chris On Mon, 18 Jan 1999, Matthew Dillon wrote: Ok, I believe I have found the bug. Please test the patch included below. I was able to make /usr/ports/x11/XFree86-contrib after applying this patch ( and it was screwing up prior to that ). The problem is in getblk() - code was added to validate the buffer and to clear B_CACHE if the bp was not entirely valid. The problem is that NFS uses B_CACHE to flag a dirty buffer that needs to be written out! Additionally, a write() to an NFS based file may write data that is not on a DEV_BSIZE'd boundry which causes a subsequent read() to improperly clear B_CACHE. There are almost certainly more problems like this -- using B_CACHE to mark a buffer dirty is just plain dumb, it's no wonder NFS is so screwed up! -Matt Matthew Dillon dil...@backplane.com Index: kern/vfs_bio.c === RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.192 diff -u -r1.192 vfs_bio.c --- vfs_bio.c 1999/01/12 11:59:34 1.192 +++ vfs_bio.c 1999/01/18 13:25:27 @@ -1364,6 +1364,7 @@ break; } } + boffset = (i PAGE_SHIFT) - (bp-b_offset PAGE_MASK); if (boffset bp-b_dirtyoff) { bp-b_dirtyoff = max(boffset, 0); @@ -1457,7 +1458,14 @@ } KASSERT(bp-b_offset != NOOFFSET, (getblk: no buffer offset)); +#if 0 /* + * XXX REMOVED XXX - this is bogus. It will cause the + * B_CACHE flag to be cleared for a partially constituted + * dirty buffer (NFS) that happens to have a write that is + * not on a DEV_BSIZE boundry!! XXX REMOVED + */ + /* * Check that the constituted buffer really deserves for the * B_CACHE bit to be set. B_VMIO type buffers might not * contain fully valid pages. Normal (old-style) buffers @@ -1478,6 +1486,7 @@ poffset = 0; } } +#endif if (bp-b_usecount BUF_MAXUSE) ++bp-b_usecount; To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
The check is correct and should be there, the B_CACHE bit was cleared because I made a mistake when setting the valid bit in the vm page. Index: vfs_bio.c === RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.192 diff -u -r1.192 vfs_bio.c --- vfs_bio.c 1999/01/12 11:59:34 1.192 +++ vfs_bio.c 1999/01/18 14:45:33 @@ -2171,7 +2171,7 @@ (vm_offset_t) (soff PAGE_MASK), (vm_offset_t) (eoff - soff)); sv = (bp-b_offset + bp-b_validoff + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); - ev = (bp-b_offset + bp-b_validend) ~(DEV_BSIZE - 1); + ev = (bp-b_offset + bp-b_validend + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); soff = qmax(sv, soff); eoff = qmin(ev, eoff); } Note the calculation of ev, the original code was a round-up and I changed it to round-down in my -r1.188 commit (I thought it was a bug in the original code, but it was actually me who didn't understand the nfs code well enough). -lq To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message
Re: NFS problem found - pleaes try this patch.
A. Yes, I see. I will unapply my patch and apply this one and test it. I'm not sure what the use of having m-valid and m-clean bits are at all if we have to munge them like this. Perhaps we should change these vm_page_t to a byte range in -4.0. I think we also need to redefine the way dirty bp's are handled, though, and at least panic if it tries to clear B_CACHE on something that B_CACHE should not be cleared on. -Matt Matthew Dillon dil...@backplane.com :The check is correct and should be there, the B_CACHE bit was cleared because :I made a mistake when setting the valid bit in the vm page. : :Index: vfs_bio.c :=== :RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v :retrieving revision 1.192 :diff -u -r1.192 vfs_bio.c :--- vfs_bio.c 1999/01/12 11:59:34 1.192 :+++ vfs_bio.c 1999/01/18 14:45:33 :@@ -2171,7 +2171,7 @@ : (vm_offset_t) (soff PAGE_MASK), : (vm_offset_t) (eoff - soff)); : sv = (bp-b_offset + bp-b_validoff + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); :- ev = (bp-b_offset + bp-b_validend) ~(DEV_BSIZE - 1); :+ ev = (bp-b_offset + bp-b_validend + DEV_BSIZE - 1) ~(DEV_BSIZE - 1); : soff = qmax(sv, soff); : eoff = qmin(ev, eoff); : } : :Note the calculation of ev, the original code was a round-up and I changed it :to round-down in my -r1.188 commit (I thought it was a bug in the original :code, but it was actually me who didn't understand the nfs code well enough). : :-lq To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-current in the body of the message