diff options
Diffstat (limited to 'fs/sysv/itree.c')
-rw-r--r-- | fs/sysv/itree.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c index 82a005c3d7eb..9ca66276315e 100644 --- a/fs/sysv/itree.c +++ b/fs/sysv/itree.c | |||
@@ -468,9 +468,16 @@ static int sysv_write_begin(struct file *file, struct address_space *mapping, | |||
468 | loff_t pos, unsigned len, unsigned flags, | 468 | loff_t pos, unsigned len, unsigned flags, |
469 | struct page **pagep, void **fsdata) | 469 | struct page **pagep, void **fsdata) |
470 | { | 470 | { |
471 | *pagep = NULL; | 471 | int ret; |
472 | return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 472 | |
473 | get_block); | 473 | ret = block_write_begin(mapping, pos, len, flags, pagep, get_block); |
474 | if (unlikely(ret)) { | ||
475 | loff_t isize = mapping->host->i_size; | ||
476 | if (pos + len > isize) | ||
477 | vmtruncate(mapping->host, isize); | ||
478 | } | ||
479 | |||
480 | return ret; | ||
474 | } | 481 | } |
475 | 482 | ||
476 | static sector_t sysv_bmap(struct address_space *mapping, sector_t block) | 483 | static sector_t sysv_bmap(struct address_space *mapping, sector_t block) |