Date: Thu, 13 Dec 2001 11:00:25 -0800 From: Terry Lambert <tlambert2@mindspring.com> To: Matthew Dillon <dillon@apollo.backplane.com> Cc: David Greenman <dg@root.com>, Jordan Hubbard <jkh@winston.freebsd.org>, Peter Wemm <peter@wemm.org>, Mike Smith <msmith@FreeBSD.ORG>, hackers@FreeBSD.ORG, msmith@mass.dis.org Subject: Re: NFS Patch #4 -- survived overnight test. (was Re: Found NFS data corruption bug... (was Re:...)) Message-ID: <3C18FAC9.E743DAA5@mindspring.com> References: <58885.1008217148@winston.freebsd.org> <200112130608.fBD689K49906@apollo.backplane.com> <20011212224927.A73226@nexus.root.com> <200112131835.fBDIZuL70031@apollo.backplane.com>
index | next in thread | previous in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C18FAC9.E743DAA5>
