projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libata: irq-pio build fixes
[powerpc.git]
/
fs
/
direct-io.c
diff --git
a/fs/direct-io.c
b/fs/direct-io.c
index
30dbbd1
..
848044a
100644
(file)
--- 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;
/* Handle holes */
if (!buffer_mapped(map_bh)) {
char *kaddr;
+ loff_t i_size_aligned;
/* AKPM: eargh, -ENOTBLK is a hack */
if (dio->rw == WRITE) {
/* AKPM: eargh, -ENOTBLK is a hack */
if (dio->rw == WRITE) {
@@
-864,8
+865,14
@@
do_holes:
return -ENOTBLK;
}
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 >=
if (dio->block_in_file >=
-
i_size_read(dio->inode)>>
blkbits) {
+
i_size_aligned >>
blkbits) {
/* We hit eof */
page_cache_release(page);
goto out;
/* We hit eof */
page_cache_release(page);
goto out;