Merge to Fedora Core 2 kernel-2.6.8-1.521
[linux-2.6.git] / fs / mpage.c
index 79fdc78..71c7ca3 100644 (file)
@@ -553,7 +553,12 @@ alloc_new:
                        bh = bh->b_this_page;
                } while (bh != head);
 
-               if (buffer_heads_over_limit)
+               /*
+                * we cannot drop the bh if the page is not uptodate
+                * or a concurrent readpage would fail to serialize with the bh
+                * and it would read from disk before we reach the platter.
+                */
+               if (buffer_heads_over_limit && PageUptodate(page))
                        try_to_free_buffers(page);
        }