[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] biosdisk / open_device() messing up offsets

From: Pavel Roskin
Subject: Re: [PATCH] biosdisk / open_device() messing up offsets
Date: Fri, 13 Jun 2008 01:00:27 -0400
User-agent: Internet Messaging Program (IMP) H3 (4.1.4)

Quoting Bean <address@hidden>:

On Fri, Jun 13, 2008 at 12:31 PM, Pavel Roskin <address@hidden> wrote:
Quoting Bean <address@hidden>:

After more thoughts, I think the current method still have problem.
grub_disk_read reads up to 8192 bytes at a time, which can be larger
than the block size.

But we never ask grub_disk_read() to read across the block boundary in
grub_fshelp_read().  The code takes care of it.  I assume grub_disk_read()
would not write more than requested to the buffer.

grub_disk_read would attempt to read up to GRUB_DISK_CACHE_SIZE and
put the result in a cache, then copy the necessary part to output.

Then I don't see any problem with it.  Maybe you could give an example?

Unless all or none of the sectors in the same
block is mapped, we end up reading the wrong sector. So we need to do
the mapping inside grub_disk_read.

But mapping is done for blocks, not for sectors.  grub_fshelp_map_block()
clearly assumes that for every filesystem.

block size is fs related, but most are less than 8192 bytes.

I don't understand why caching would have any effect. It should be transparent for higher layers, like caching inside the hard drive. If caching is not transparent, then it's broken.

Pavel Roskin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]