summaryrefslogtreecommitdiffstats
path: root/fs/affs
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2017-04-24 22:13:10 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-26 23:54:06 -0400
commita80f2d2224544f708b50091b18753f4b530f70c1 (patch)
tree3fd08cd95bea4b44a3dbfa844471f8f3da1b61b6 /fs/affs
parent077e073e8f9ebc6bdd3f3f0324b16db07147a232 (diff)
downloadlinux-a80f2d2224544f708b50091b18753f4b530f70c1.tar.bz2
fs/affs: bugfix: Write files greater than page size on OFS
Previous AFFS patch fixed OFS write operations but unveiled another bug: files greater than 4KB are being created with a wrong size resulting in errors like the following: dd if=/dev/zero of=file bs=4097 count=1 cp file /mnt/affs/ cp: error writing '/mnt/affs/file': Bad address Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c
index e5c5de6b85e5..196ee7f6fdc4 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -679,7 +679,7 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
int written;
from = pos & (PAGE_SIZE - 1);
- to = pos + len;
+ to = from + len;
/*
* XXX: not sure if this can handle short copies (len < copied), but
* we don't have to, because the page should always be uptodate here,