From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5FC4C48BD6 for ; Wed, 26 Jun 2019 13:23:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8E8A216C8 for ; Wed, 26 Jun 2019 13:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727579AbfFZNXu (ORCPT ); Wed, 26 Jun 2019 09:23:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48770 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfFZNXt (ORCPT ); Wed, 26 Jun 2019 09:23:49 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA2D8309265B; Wed, 26 Jun 2019 13:23:49 +0000 (UTC) Received: from max.com (unknown [10.40.205.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95A741001B0E; Wed, 26 Jun 2019 13:23:43 +0000 (UTC) From: Andreas Gruenbacher To: Christoph Hellwig , linux-fsdevel@vger.kernel.org Cc: cluster-devel@redhat.com, linux-xfs@vger.kernel.org, Andreas Gruenbacher Subject: [PATCH v2 3/3] iomap: fix page_done callback for short writes Date: Wed, 26 Jun 2019 15:23:35 +0200 Message-Id: <20190626132335.14809-3-agruenba@redhat.com> In-Reply-To: <20190626132335.14809-1-agruenba@redhat.com> References: <20190626132335.14809-1-agruenba@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 26 Jun 2019 13:23:49 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org When we truncate a short write to have it retried, pass the truncated length to the page_done callback instead of the full length. Signed-off-by: Andreas Gruenbacher --- fs/iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/iomap.c b/fs/iomap.c index 97569064faaa..9a9d016b2782 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -803,7 +803,7 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len, if (old_size < pos) pagecache_isize_extended(inode, old_size, pos); if (page_ops && page_ops->page_done) - page_ops->page_done(inode, pos, copied, page, iomap); + page_ops->page_done(inode, pos, ret, page, iomap); put_page(page); if (ret < len) -- 2.20.1