Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp565989ybp; Wed, 9 Oct 2019 00:13:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYAqZkgJ9+r7Rs0hi2QfSIJhPpNy4OAOYYmWdwmDfdLg+jEcTG6AxUPcBhGMxlTGc3R3Qe X-Received: by 2002:a50:ed0b:: with SMTP id j11mr1670384eds.50.1570605184938; Wed, 09 Oct 2019 00:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570605184; cv=none; d=google.com; s=arc-20160816; b=q8TCLOynwYSNbNb+Dnl6XjBeQzt+QKL2b9+CK9UMkSlEnpiJ4cwDx/8djIU/45VOCp rQzGniB5w9MY6TQQlMJjySVt41cgomqobJ+WIbb8UqRmuartl0oTv0ywRC1wLCe24Jcx clc1RNhwhpcAWRmnS4vHoDHfLzOJtaFl9IMRpIRw6ICCyoXvWokKQeVldLuHbFCU/UWX jfhXqmkzV0oMfPqwSt27Q9q+/P7nfuM0+MZEvxjLTbkWWl/KEG4P4Si3QY+NR0jvkXub jrFmjbEwsmNinpXw3nnshRzBj7A9FSrRfhDTlpgOjy+o77ES8rbCBK+JDMwpWwoFbliY e47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6+sFNh9sdecUMLKw+OaXj40ADI+ElyZNUMxdlvfGrTE=; b=TCK04WeppP6fiaUh15zBPwHY/txwKYORWkpVaTfXL31hTB/EPIidBpcnDoIPp5UZ7H a48stXK3ik9jw9oJoJRItKkeewqGOsK4xcKQTEM1BRopYg4PHi3VPHjXLDrSaOO1lQsn EnNnOR/RXhg73yIdA6axE98xM1VsuTe6V3kEl2gLmy/Ev0hnCP074lyHW7e6VIl6C059 LATYDAYt6uXf1Pr5NiHycTshi5n2T99gVnrsOn35D+FZwUrRWtnLSmnR8OcLQ0OtIdaD 1pIVoCaj8V8HKQRyxDFfkmGIywtxC7pZjaDTTDdGMKhZ59bXi2TZYn9y8X7sCjHEt6mJ TNLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KcTxP8V3; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f19si782854edb.385.2019.10.09.00.12.40; Wed, 09 Oct 2019 00:13:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KcTxP8V3; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725848AbfJIHLr (ORCPT + 99 others); Wed, 9 Oct 2019 03:11:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55448 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbfJIHLr (ORCPT ); Wed, 9 Oct 2019 03:11:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=6+sFNh9sdecUMLKw+OaXj40ADI+ElyZNUMxdlvfGrTE=; b=KcTxP8V34WjBLbWUB5h2X2Xi6 Dpqz31GU+u5ifbnFp6jrnxDiFo4wBcvdywV+QbolbN4eWxk9FPseLHMmbdBifRQ8cfCGzNxx9TcsM QuzVr/6YaV7YFF3kmwH5lTotDszmsdVBKIKWr71SXbHMcgWigL8gM5d0iwlVHmcOIPHaA7JP4865j 6+zr21e72dtuw7BuabX6uVibCREjSUAeKVKVgROgiNC2rDqcvzrjxjHgbwyaC0LOouYrWJ3kVwbU4 1PuiJzz24QYnBXaqpdh1MpuMUMhDi8DneFPjsleCrOBoZYFSzulclGKsfxMlpNZTEIXBQkzKFvbdB LRlwz8bVA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iI68P-0002Xs-3v; Wed, 09 Oct 2019 07:11:45 +0000 Date: Wed, 9 Oct 2019 00:11:45 -0700 From: Christoph Hellwig To: Jan Kara Cc: Matthew Bobrowski , tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH v4 8/8] ext4: introduce direct I/O write path using iomap infrastructure Message-ID: <20191009071145.GB32281@infradead.org> References: <9ef408b4079d438c0e6071b862c56fc8b65c3451.1570100361.git.mbobrowski@mbobrowski.org> <20191008151238.GK5078@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008151238.GK5078@quack2.suse.cz> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 08, 2019 at 05:12:38PM +0200, Jan Kara wrote: > Seeing how difficult it is when a filesystem wants to complete the iocb > synchronously (regardless whether it is async or sync) and have all the > information in one place for further processing, I think it would be the > easiest to provide iomap_dio_rw_wait() that forces waiting for the iocb to > complete *and* returns the appropriate return value instead of pretty > useless EIOCBQUEUED. It is actually pretty trivial (patch attached). With > this we can then just call iomap_dio_rw_sync() for the inode extension case > with ->end_io doing just the unwritten extent processing and then call > ext4_handle_inode_extension() from ext4_direct_write_iter() where we would > have all the information we need. > > Christoph, Darrick, what do you think about extending iomap like in the > attached patch (plus sample use in XFS)? I vaguely remember suggesting something like this but Brian or Dave convinced me it wasn't a good idea. This will require a trip to the xfs or fsdevel archives from when the inode_dio_wait was added in XFS. But if we decide it actully works this time around please don't add the __ variant but just add the parameter to iomap_dio_rw directly.