git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://neil.brown.name/md
[sfrench/cifs-2.6.git]
/
fs
/
affs
/
file.c
diff --git
a/fs/affs/file.c
b/fs/affs/file.c
index 322710c3eedf25c35ca4ca5888e4c2ab96bed728..c4a9875bd1a60520c682bed74f7a27bc3d2e1da0 100644
(file)
--- a/
fs/affs/file.c
+++ b/
fs/affs/file.c
@@
-406,10
+406,19
@@
static int affs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
+ int ret;
+
*pagep = NULL;
*pagep = NULL;
- ret
urn
cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret
=
cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
affs_get_block,
&AFFS_I(mapping->host)->mmu_private);
affs_get_block,
&AFFS_I(mapping->host)->mmu_private);
+ if (unlikely(ret)) {
+ loff_t isize = mapping->host->i_size;
+ if (pos + len > isize)
+ vmtruncate(mapping->host, isize);
+ }
+
+ return ret;
}
static sector_t _affs_bmap(struct address_space *mapping, sector_t block)
}
static sector_t _affs_bmap(struct address_space *mapping, sector_t block)