aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 351e18ea2e53..ad5938ca357c 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -921,6 +921,7 @@ init_page_buffers(struct page *page, struct block_device *bdev,
921 struct buffer_head *head = page_buffers(page); 921 struct buffer_head *head = page_buffers(page);
922 struct buffer_head *bh = head; 922 struct buffer_head *bh = head;
923 int uptodate = PageUptodate(page); 923 int uptodate = PageUptodate(page);
924 sector_t end_block = blkdev_max_block(I_BDEV(bdev->bd_inode));
924 925
925 do { 926 do {
926 if (!buffer_mapped(bh)) { 927 if (!buffer_mapped(bh)) {
@@ -929,7 +930,8 @@ init_page_buffers(struct page *page, struct block_device *bdev,
929 bh->b_blocknr = block; 930 bh->b_blocknr = block;
930 if (uptodate) 931 if (uptodate)
931 set_buffer_uptodate(bh); 932 set_buffer_uptodate(bh);
932 set_buffer_mapped(bh); 933 if (block < end_block)
934 set_buffer_mapped(bh);
933 } 935 }
934 block++; 936 block++;
935 bh = bh->b_this_page; 937 bh = bh->b_this_page;