From: Fabian Frederick Date: Mon, 24 Apr 2017 20:13:10 +0000 (+0200) Subject: fs/affs: bugfix: Write files greater than page size on OFS X-Git-Tag: v4.12-rc1~59^2~11 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a80f2d2224544f708b50091b18753f4b530f70c1;p=linux.git 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 Signed-off-by: Al Viro --- 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,