diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-22 21:05:13 -0500 |
commit | feaf222925cdfbc841a695fd30df8c6d0a694146 (patch) | |
tree | 9bba94f19346cd3cba0223741b38885b898491ae /fs/ext4/inode.c | |
parent | be5e6616dd74e17fdd8e16ca015cfef94d49b467 (diff) | |
parent | 6f30b7e37a8239f9d27db626a1d3427bc7951908 (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o:
"Ext4 bug fixes.
We also reserved code points for encryption and read-only images (for
which the implementation is mostly just the reserved code point for a
read-only feature :-)"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: fix indirect punch hole corruption
ext4: ignore journal checksum on remount; don't fail
ext4: remove duplicate remount check for JOURNAL_CHECKSUM change
ext4: fix mmap data corruption in nodelalloc mode when blocksize < pagesize
ext4: support read-only images
ext4: change to use setup_timer() instead of init_timer()
ext4: reserve codepoints used by the ext4 encryption feature
jbd2: complain about descriptor block checksum errors
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 85404f15e53a..5cb9a212b86f 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1024,6 +1024,7 @@ static int ext4_write_end(struct file *file, | |||
1024 | { | 1024 | { |
1025 | handle_t *handle = ext4_journal_current_handle(); | 1025 | handle_t *handle = ext4_journal_current_handle(); |
1026 | struct inode *inode = mapping->host; | 1026 | struct inode *inode = mapping->host; |
1027 | loff_t old_size = inode->i_size; | ||
1027 | int ret = 0, ret2; | 1028 | int ret = 0, ret2; |
1028 | int i_size_changed = 0; | 1029 | int i_size_changed = 0; |
1029 | 1030 | ||
@@ -1054,6 +1055,8 @@ static int ext4_write_end(struct file *file, | |||
1054 | unlock_page(page); | 1055 | unlock_page(page); |
1055 | page_cache_release(page); | 1056 | page_cache_release(page); |
1056 | 1057 | ||
1058 | if (old_size < pos) | ||
1059 | pagecache_isize_extended(inode, old_size, pos); | ||
1057 | /* | 1060 | /* |
1058 | * Don't mark the inode dirty under page lock. First, it unnecessarily | 1061 | * Don't mark the inode dirty under page lock. First, it unnecessarily |
1059 | * makes the holding time of page lock longer. Second, it forces lock | 1062 | * makes the holding time of page lock longer. Second, it forces lock |
@@ -1095,6 +1098,7 @@ static int ext4_journalled_write_end(struct file *file, | |||
1095 | { | 1098 | { |
1096 | handle_t *handle = ext4_journal_current_handle(); | 1099 | handle_t *handle = ext4_journal_current_handle(); |
1097 | struct inode *inode = mapping->host; | 1100 | struct inode *inode = mapping->host; |
1101 | loff_t old_size = inode->i_size; | ||
1098 | int ret = 0, ret2; | 1102 | int ret = 0, ret2; |
1099 | int partial = 0; | 1103 | int partial = 0; |
1100 | unsigned from, to; | 1104 | unsigned from, to; |
@@ -1127,6 +1131,9 @@ static int ext4_journalled_write_end(struct file *file, | |||
1127 | unlock_page(page); | 1131 | unlock_page(page); |
1128 | page_cache_release(page); | 1132 | page_cache_release(page); |
1129 | 1133 | ||
1134 | if (old_size < pos) | ||
1135 | pagecache_isize_extended(inode, old_size, pos); | ||
1136 | |||
1130 | if (size_changed) { | 1137 | if (size_changed) { |
1131 | ret2 = ext4_mark_inode_dirty(handle, inode); | 1138 | ret2 = ext4_mark_inode_dirty(handle, inode); |
1132 | if (!ret) | 1139 | if (!ret) |