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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26CE9C433EF for ; Fri, 27 May 2022 05:41:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235986AbiE0Flg (ORCPT ); Fri, 27 May 2022 01:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231261AbiE0Fle (ORCPT ); Fri, 27 May 2022 01:41:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94550AF1D9 for ; Thu, 26 May 2022 22:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=sJ7J59z0CujPyPzVAWKZfbM4pcB3EWazV5XBof/U/fE=; b=JtYPhDYe2SDIh0bUZqKrL3n6T2 CZFYdT86g49McBP2n+usIOP3Kl0D1LFwzkzRlSytajR+0tijc7THAaut9T8bus3UCzLY+7aF5TXAi MTtwCIR10+BV/AqV+8RWlRiVPg5s6tPon0kgncewBD+4M7SySFCuhIkWUOGaCucNGSm1s+vkF3y92 5GWMnMLmtec3usB64/8un+P3cZCvJjwbA7hvNn5yO1t9RCtJijxhAEV8fvwQHrZtoB/t96YLbEfiW l2aitakw8F2FGxAeABWDyqEYj0hWA/gIj0lUAFooBGdlp/fWyFd1Ux0zylW85Dw8CgMVJvhEzzXLf zNwaIe2g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuSj5-00GgzL-Nx; Fri, 27 May 2022 05:41:31 +0000 Date: Thu, 26 May 2022 22:41:31 -0700 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: jfs-discussion@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Darrick J . Wong" Subject: Re: [RFC PATCH 2/9] jfs: Add jfs_iomap_begin() Message-ID: References: <20220526192910.357055-1-willy@infradead.org> <20220526192910.357055-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220526192910.357055-3-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org I suspect this might be where your problems lies: blockdev_direct_IO calls __blockdev_direct_IO with DIO_SKIP_HOLES set. DIO_SKIP_HOLES causes get_more_blocks to never set the create bit to get_block except for writes beyond i_size. If we want to replicate that behavior with iomap, ->iomap_begin needs to return -ENOTBLK when it encounters a hole for writing. To properly supporting writing to holes we'd need unwritten extents, which jfs does not support. gfs2 might be a place to look for how to implement this.