Commit d1da42b4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ramdisk: buffer_uptodate fix

I waffled over this for ages.  On balance, I think it's best to mark those
bh's as uptodate.

And on reflection, I'm not sure why we go bringing ramdisk blockdev pages
uptodate all over the place anyway.  But ramdisk is weird and it passes
testing.  Let those dogs sleep.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 39ecf09b
......@@ -108,8 +108,21 @@ static void make_page_uptodate(struct page *page)
struct buffer_head *head = bh;
do {
if (!buffer_uptodate(bh))
if (!buffer_uptodate(bh)) {
memset(bh->b_data, 0, bh->b_size);
/*
* akpm: I'm totally undecided about this. The
* buffer has just been magically brought "up to
* date", but nobody should want to be reading
* it anyway, because it hasn't been used for
* anything yet. It is still in a "not read
* from disk yet" state.
*
* But non-uptodate buffers against an uptodate
* page are against the rules. So do it anyway.
*/
set_buffer_uptodate(bh);
}
} while ((bh = bh->b_this_page) != head);
} else {
memset(page_address(page), 0, PAGE_CACHE_SIZE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment