Return-Path: Received: from mailrelay103.isp.belgacom.be ([195.238.20.130]:17662 "EHLO mailrelay103.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1174255AbdDXUNP (ORCPT ); Mon, 24 Apr 2017 16:13:15 -0400 From: Fabian Frederick To: Andrew Morton Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, fabf@skynet.be Subject: [PATCH 2/2 linux-next] fs/affs: bugfix: Write files greater than page size on OFS Date: Mon, 24 Apr 2017 22:13:10 +0200 Message-Id: <20170424201310.1796-1-fabf@skynet.be> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- fs/affs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/file.c b/fs/affs/file.c index e5c5de6..196ee7f 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, -- 2.9.3