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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no 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 A59D2ECE587 for ; Mon, 14 Oct 2019 08:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78D5520673 for ; Mon, 14 Oct 2019 08:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730390AbfJNI0N (ORCPT ); Mon, 14 Oct 2019 04:26:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:60208 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730381AbfJNI0N (ORCPT ); Mon, 14 Oct 2019 04:26:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2CD0EB4FC; Mon, 14 Oct 2019 08:26:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B006F1E4A86; Mon, 14 Oct 2019 10:26:10 +0200 (CEST) From: Jan Kara To: Cc: Christoph Hellwig , darrick.wong@oracle.com, , Matthew Bobrowski , Dave Chinner , Jan Kara Subject: [PATCH 0/2 v3] iomap: Waiting for IO in iomap_dio_rw() Date: Mon, 14 Oct 2019 10:26:01 +0200 Message-Id: <20191014082418.13885-1-jack@suse.cz> X-Mailer: git-send-email 2.16.4 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Hello, here is new version of the series with the small change requested by Darrick. Changes since v2: * Changed iomap_dio_rw() to return -EIO in case caller doesn't ask it to wait for sync kiocb. Changes since v1: * The new function argument of iomap_dio_rw() does not get overridden by is_sync_kiocb() the caller is responsible for this. --- Original motivation: when doing the ext4 conversion of direct IO code to iomap, we found it very difficult to handle inode extension with what iomap code currently provides. Ext4 wants to do inode extension as sync IO (so that the whole duration of IO is protected by inode->i_rwsem), also we need to truncate blocks beyond end of file in case of error or short write. Now in ->end_io handler we don't have the information how long originally the write was (to judge whether we may have allocated more blocks than we actually used) and in ->write_iter we don't know whether / how much of the IO actually succeeded in case of AIO. Thinking about it for some time I think iomap code makes it unnecessarily complex for the filesystem in case it decides it doesn't want to perform AIO and wants to fall back to good old synchronous IO. In such case it is much easier for the filesystem if it just gets normal error return from iomap_dio_rw() and not just -EIOCBQUEUED. The first patch in the series adds argument to iomap_dio_rw() to wait for IO completion (internally iomap_dio_rw() already supports this!) and the second patch converts XFS waiting for unaligned DIO write to this new API. Honza Previous versions: Link: http://lore.kernel.org/r/20191009202736.19227-1-jack@suse.cz Link: http://lore.kernel.org/r/20191011125520.11697-1-jack@suse.cz