From patchwork Mon Apr 24 20:13:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 9697127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C77C3601E9 for ; Mon, 24 Apr 2017 20:13:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE84128066 for ; Mon, 24 Apr 2017 20:13:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B353A28419; Mon, 24 Apr 2017 20:13:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C55128066 for ; Mon, 24 Apr 2017 20:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1174263AbdDXUNS (ORCPT ); Mon, 24 Apr 2017 16:13:18 -0400 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 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AMz8u1xdpnbyWY2Gnxw9FYgxalGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc66ZB7h7PlgxGXEQZ/co6odzbGJ4+a9ASQp2tWojjMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpRZbIBj0NBJ0?= =?us-ascii?q?K+LpAcaSyp3vj6Hhs6HUNixOiCCwfvtXKw+qqgOZ4sAVmY5KLqc31wuMrHxVfe?= =?us-ascii?q?hf2WJvIxSUhRmqtemq+5s23S1auvsnv+BaXKn3ZaUzTvQMAj0sPUgu59ztuAWF?= =?us-ascii?q?RwbZtShUaXkfjhcdW1uN1xr9RJqk93Ki7uc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AkBQAVW/5Y/zfGs1tdHQwGGAYMgkBrg?= =?us-ascii?q?W2Ob5EjAZdJhiSEFUMVAQEBAQEBAQEBAQFqKIIzBAEdAQSDGCMpcSQTig8RrVm?= =?us-ascii?q?EEIc+hlOBXYdAhXYfBZ1BknkNkVeUGTUigQZDHRiEXQELeYFMPjWGeW6BTwEBA?= =?us-ascii?q?Q?= X-IPAS-Result: =?us-ascii?q?A2AkBQAVW/5Y/zfGs1tdHQwGGAYMgkBrgW2Ob5EjAZdJhiS?= =?us-ascii?q?EFUMVAQEBAQEBAQEBAQFqKIIzBAEdAQSDGCMpcSQTig8RrVmEEIc+hlOBXYdAh?= =?us-ascii?q?XYfBZ1BknkNkVeUGTUigQZDHRiEXQELeYFMPjWGeW6BTwEBAQ?= Received: from 55.198-179-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.179.198.55]) by relay.skynet.be with ESMTP; 24 Apr 2017 22:13:12 +0200 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> X-Mailer: git-send-email 2.9.3 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,