Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210383
b: refs/heads/master
c: f63afdb
h: refs/heads/master
i:
  210381: f0c58e2
  210379: ddd070f
  210375: 2917e0e
  210367: 66b40c4
v: v3
  • Loading branch information
Tao Ma committed Sep 8, 2010
1 parent f7008e3 commit 011e156
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5ce5a08a40f2086435858ddc80cb40394b082eb
refs/heads/master: f63afdb2c32db850fa1bfccf84643a8885cbeb61
8 changes: 5 additions & 3 deletions trunk/fs/ocfs2/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
/*
* Another node might have truncated while we were waiting on
* cluster locks.
* We don't check size == 0 before the shift. This is borrowed
* from do_generic_file_read.
*/
last_index = size >> PAGE_CACHE_SHIFT;
if (page->index > last_index) {
last_index = (size - 1) >> PAGE_CACHE_SHIFT;
if (unlikely(!size || page->index > last_index)) {
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -107,7 +109,7 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
* because the "write" would invalidate their data.
*/
if (page->index == last_index)
len = size & ~PAGE_CACHE_MASK;
len = ((size - 1) & ~PAGE_CACHE_MASK) + 1;

ret = ocfs2_write_begin_nolock(mapping, pos, len, 0, &locked_page,
&fsdata, di_bh, page);
Expand Down

0 comments on commit 011e156

Please sign in to comment.