Re: [PATCH] IDE: Do not call bh_phys() on buffers with invalid b_page.

From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Wed Jan 29 2003 - 10:44:15 EST


On Wed, 2003-01-29 at 16:38, Jens Axboe wrote:
> No, any b_data < PAGE_OFFSET is not wrong, that's the point. For highmem
> b_page, b_data will be the offset into the page. So it could be 2048,
> for instance.

In the other if() case, yes ;)

> The test is meant to catch an invalid buffer_head, where b_page is not
> set but b_data isn't valid either. So to make it complete, you could do:

Yup, I undestood that.

> if (bh->b_data < PAGE_SIZE)
> BUG();
> if (bh->b_data < PAGE_OFFSET)
> BUG();
> }

All I wanted to spot is that < PAGE_OFFSET would catch the PAGE_SIZE bug
as well ;) But that's not a problem in real life anyway it seems.

-- 
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 31 2003 - 22:00:22 EST