From owner-freebsd-hackers Thu Dec 13 11: 0:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id 4B16537B425; Thu, 13 Dec 2001 11:00:33 -0800 (PST) Received: from pool0215.cvx22-bradley.dialup.earthlink.net ([209.179.198.215] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Eb5g-0005u5-00; Thu, 13 Dec 2001 11:00:20 -0800 Message-ID: <3C18FAC9.E743DAA5@mindspring.com> Date: Thu, 13 Dec 2001 11:00:25 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Matthew Dillon Cc: David Greenman , Jordan Hubbard , Peter Wemm , Mike Smith , hackers@FreeBSD.ORG, msmith@mass.dis.org Subject: Re: NFS Patch #4 -- survived overnight test. (was Re: Found NFS data corruption bug... (was Re:...)) References: <58885.1008217148@winston.freebsd.org> <200112130608.fBD689K49906@apollo.backplane.com> <20011212224927.A73226@nexus.root.com> <200112131835.fBDIZuL70031@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matthew Dillon wrote: [ ... ] > I would appreciate other VM gurus taking a look at the > vm_page_set_validclean() changes. [ ... ] Not to appoint myself a guru or anything... > +#if 1 > + if ((base & (DEV_BSIZE - 1)) || (size & (DEV_BSIZE - 1))) { > + int adj; > + > + adj = DEV_BSIZE - (base & (DEV_BSIZE - 1)); > + base += adj; > + if (size < adj) > + size = 0; > + else > + size = (size - adj) & ~(DEV_BSIZE - 1); > + pagebits = vm_page_bits(base, size); > + } > +#endif This seems wrong. Specifically, it seems to only get the first block, in the case that (integer math: / is "div"): ((size - adj)/DEV_BSIZE) > 1 How about: else { /* * Drop partial trailing blocks from the size * calculation to maintain correct dirty bits; * note that 'size' might still span more than * one block, though. */ int n_size; /* probably not int? */ n_size = (size - adj) / DEV_BSIZE; size = (size - adj) & ~(DEV_BSIZE - 1); size += n_size * DEV_BSIZE; } -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message