diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2006-02-09 00:58:59 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-09 00:58:59 -0500 |
| commit | cac0e8e8bb2e7a086643bdd00c41d900a79bb4fa (patch) | |
| tree | 73cd85e5529a01fa2338ab6d58b99c36dd666cbe /fs/direct-io.c | |
| parent | ddef9bb367b19383df627e388cb4c01c86ddba6c (diff) | |
| parent | 0bdd340c092b0936f78a54bdbd3927463ed4fca3 (diff) | |
| download | net-cac0e8e8bb2e7a086643bdd00c41d900a79bb4fa.tar.gz | |
Merge branch 'master'
Diffstat (limited to 'fs/direct-io.c')
| -rw-r--r-- | fs/direct-io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index 30dbbd1df51191..848044af7e1677 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -857,6 +857,7 @@ do_holes: /* Handle holes */ if (!buffer_mapped(map_bh)) { char *kaddr; + loff_t i_size_aligned; /* AKPM: eargh, -ENOTBLK is a hack */ if (dio->rw == WRITE) { @@ -864,8 +865,14 @@ do_holes: return -ENOTBLK; } + /* + * Be sure to account for a partial block as the + * last block in the file + */ + i_size_aligned = ALIGN(i_size_read(dio->inode), + 1 << blkbits); if (dio->block_in_file >= - i_size_read(dio->inode)>>blkbits) { + i_size_aligned >> blkbits) { /* We hit eof */ page_cache_release(page); goto out; |
