diff options
Diffstat (limited to 'fs/adfs')
-rw-r--r-- | fs/adfs/inode.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 6f850b06ab62..65794b8fe79e 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c | |||
@@ -50,10 +50,19 @@ static int adfs_write_begin(struct file *file, struct address_space *mapping, | |||
50 | loff_t pos, unsigned len, unsigned flags, | 50 | loff_t pos, unsigned len, unsigned flags, |
51 | struct page **pagep, void **fsdata) | 51 | struct page **pagep, void **fsdata) |
52 | { | 52 | { |
53 | int ret; | ||
54 | |||
53 | *pagep = NULL; | 55 | *pagep = NULL; |
54 | return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 56 | ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
55 | adfs_get_block, | 57 | adfs_get_block, |
56 | &ADFS_I(mapping->host)->mmu_private); | 58 | &ADFS_I(mapping->host)->mmu_private); |
59 | if (unlikely(ret)) { | ||
60 | loff_t isize = mapping->host->i_size; | ||
61 | if (pos + len > isize) | ||
62 | vmtruncate(mapping->host, isize); | ||
63 | } | ||
64 | |||
65 | return ret; | ||
57 | } | 66 | } |
58 | 67 | ||
59 | static sector_t _adfs_bmap(struct address_space *mapping, sector_t block) | 68 | static sector_t _adfs_bmap(struct address_space *mapping, sector_t block) |
@@ -324,10 +333,7 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr) | |||
324 | 333 | ||
325 | /* XXX: this is missing some actual on-disk truncation.. */ | 334 | /* XXX: this is missing some actual on-disk truncation.. */ |
326 | if (ia_valid & ATTR_SIZE) | 335 | if (ia_valid & ATTR_SIZE) |
327 | error = simple_setsize(inode, attr->ia_size); | 336 | truncate_setsize(inode, attr->ia_size); |
328 | |||
329 | if (error) | ||
330 | goto out; | ||
331 | 337 | ||
332 | if (ia_valid & ATTR_MTIME) { | 338 | if (ia_valid & ATTR_MTIME) { |
333 | inode->i_mtime = attr->ia_mtime; | 339 | inode->i_mtime = attr->ia_mtime; |