diff options
Diffstat (limited to 'fs/jffs2/file.c')
-rw-r--r-- | fs/jffs2/file.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 9f4171213e58..3349db0a7863 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -215,12 +215,20 @@ static int jffs2_commit_write (struct file *filp, struct page *pg, | |||
215 | D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", | 215 | D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", |
216 | inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); | 216 | inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); |
217 | 217 | ||
218 | if (!start && end == PAGE_CACHE_SIZE) { | 218 | if (end == PAGE_CACHE_SIZE) { |
219 | /* We need to avoid deadlock with page_cache_read() in | 219 | if (!start) { |
220 | jffs2_garbage_collect_pass(). So we have to mark the | 220 | /* We need to avoid deadlock with page_cache_read() in |
221 | page up to date, to prevent page_cache_read() from | 221 | jffs2_garbage_collect_pass(). So we have to mark the |
222 | trying to re-lock it. */ | 222 | page up to date, to prevent page_cache_read() from |
223 | SetPageUptodate(pg); | 223 | trying to re-lock it. */ |
224 | SetPageUptodate(pg); | ||
225 | } else { | ||
226 | /* When writing out the end of a page, write out the | ||
227 | _whole_ page. This helps to reduce the number of | ||
228 | nodes in files which have many short writes, like | ||
229 | syslog files. */ | ||
230 | start = aligned_start = 0; | ||
231 | } | ||
224 | } | 232 | } |
225 | 233 | ||
226 | ri = jffs2_alloc_raw_inode(); | 234 | ri = jffs2_alloc_raw_inode(); |