Skip to content

Commit

Permalink
fs/affs: bugfix: Write files greater than page size on OFS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabian Frederick authored and Al Viro committed Apr 27, 2017
1 parent 077e073 commit a80f2d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a80f2d2

Please sign in to comment.