Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61983
b: refs/heads/master
c: 1833633
h: refs/heads/master
i:
  61981: 7415659
  61979: 90e50f3
  61975: 2f40a5f
  61967: 1dd89eb
  61951: b28b183
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Jul 20, 2007
1 parent 174ab8b commit 1526d45
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 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: e228929bc257b963523ed75aa60d2ad77ece2189
refs/heads/master: 1833633803c7ef4d8f09877d3f1549cbd252f477
2 changes: 1 addition & 1 deletion trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
lock_page(page);
size = i_size_read(inode);
if ((page->mapping != inode->i_mapping) ||
((page->index << PAGE_CACHE_SHIFT) > size)) {
(page_offset(page) > size)) {
/* page got truncated out from underneath us */
goto out_unlock;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/ecryptfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ static int ecryptfs_prepare_write(struct file *file, struct page *page,
if (!PageUptodate(page))
rc = ecryptfs_do_readpage(file, page, page->index);
if (page->index != 0) {
loff_t end_of_prev_pg_pos =
(((loff_t)page->index << PAGE_CACHE_SHIFT) - 1);
loff_t end_of_prev_pg_pos = page_offset(page) - 1;

if (end_of_prev_pg_pos > i_size_read(page->mapping->host)) {
rc = ecryptfs_truncate(file->f_path.dentry,
Expand Down Expand Up @@ -736,7 +735,7 @@ static int ecryptfs_commit_write(struct file *file, struct page *page,
goto out;
}
inode->i_blocks = lower_inode->i_blocks;
pos = (page->index << PAGE_CACHE_SHIFT) + to;
pos = page_offset(page) + to;
if (pos > i_size_read(inode)) {
i_size_write(inode, pos);
ecryptfs_printk(KERN_DEBUG, "Expanded file size to "
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ocfs2/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
{
int ret;
struct address_space *mapping = inode->i_mapping;
loff_t pos = page->index << PAGE_CACHE_SHIFT;
loff_t pos = page_offset(page);
unsigned int len = PAGE_CACHE_SIZE;
pgoff_t last_index;
struct page *locked_page = NULL;
Expand Down

0 comments on commit 1526d45

Please sign in to comment.