Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101105
b: refs/heads/master
c: c7d206b
h: refs/heads/master
i:
  101103: 2f678b5
v: v3
  • Loading branch information
Jan Kara authored and Theodore Ts'o committed Jul 11, 2008
1 parent d42ea67 commit f168f59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: 2e9ee850355593e311d9a26542290fe51e152f74
refs/heads/master: c7d206b3379f7d6462e778b74f475c470ee3dcaf
12 changes: 11 additions & 1 deletion trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@ int generic_write_end(struct file *file, struct address_space *mapping,
struct page *page, void *fsdata)
{
struct inode *inode = mapping->host;
int i_size_changed = 0;

copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);

Expand All @@ -2073,12 +2074,21 @@ int generic_write_end(struct file *file, struct address_space *mapping,
*/
if (pos+copied > inode->i_size) {
i_size_write(inode, pos+copied);
mark_inode_dirty(inode);
i_size_changed = 1;
}

unlock_page(page);
page_cache_release(page);

/*
* Don't mark the inode dirty under page lock. First, it unnecessarily
* makes the holding time of page lock longer. Second, it forces lock
* ordering of page lock and transaction start for journaling
* filesystems.
*/
if (i_size_changed)
mark_inode_dirty(inode);

return copied;
}
EXPORT_SYMBOL(generic_write_end);
Expand Down

0 comments on commit f168f59

Please sign in to comment.