Marcus Brinkmann <[EMAIL PROTECTED]> writes:

> On Wed, Jul 16, 2003 at 08:01:19PM +0200, Marco Gerards wrote:
> > Ok. The old code didn't work for clusters > 4096 because the call to
> > find_cluster will be split up because the pager reads the cluster in
> > two operations.
> > 
> > The cluster in a 8096 byte file will be read like this :
> > (first pagefault) offset: 0
> > (second pagefault) offset: 4096
> > 
> > 4096(offset) + 8096(clustersize) > allocsize (8096)
> > 
> > The test will fault and a EIO will be the result.
> 
> I see.  So what do you think of this one:

[...]
  
> -  if (offset + bytes_per_cluster > node->allocsize)
> +  if (round_cluster (offset) > node->allocsize)
>      return EIO;

This looks good to me, but after rounding it down you can add the
bytes_per_cluster. This solution is much better than I had.

So it should be:
"if (round_cluster (offset) + bytes_per_cluster > node->allocsize)"

I will test the code to be 100% sure it works. :)

Thanks,
Marco



_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to