]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ramdisk: buffer_uptodate fix
authorAndrew Morton <akpm@osdl.org>
Sat, 12 Jun 2004 23:45:58 +0000 (16:45 -0700)
committerLinus Torvalds <torvalds@evo.osdl.org>
Sat, 12 Jun 2004 23:45:58 +0000 (16:45 -0700)
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/rd.c

index 5566351d4b6fdebfed1faa1571b0cc8dcf4d38b9..fe8332e340f9c877e718db4940bedbc7ee996d9f 100644 (file)
@@ -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);