Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp177678rdf; Mon, 20 Nov 2023 22:08:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjtVilvr04PtMamRd9vIbyF91sUaxowK4KTtY6OW24P3ZmMHBidIYf4VR+EsL9AutBo8yE X-Received: by 2002:a05:6870:aa99:b0:1f9:55fb:2ba3 with SMTP id gr25-20020a056870aa9900b001f955fb2ba3mr3847452oab.19.1700546932324; Mon, 20 Nov 2023 22:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700546932; cv=none; d=google.com; s=arc-20160816; b=UA8Zf6yAeRXBiIO3OpoYFbGfsGdNnduwpzSCejUbXDYd+TEV5svtuO+c0oadsxLqpH +q7/XDh5342HEj8esAdtLvZTCz8T7LRZThfkr8J7D6fnwgyBYv++HqGSZrMWhXgU9uiH lFaOM9pUTXgQk+WtF4iBixvgDAQyRHLe8Sxb7sXFg5Koj62Rv0A1kJwY7tywcJT0OdxX fEvr5d5LdWH5+xNsIQetisUeImhwqBmiOO4WEr+kIo7W2IQQFpTIos+Q6ytgQ69Jw5Z8 AmNYJm90TFC9QabCDq6EuVn0gqV9lgUl3URLBtW1BQWMvTODCyTXTctHkBqeKnCpD+Cd y8Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Pu892CmklwtJGI+KPlhGZXprVPRFixMF2XsAMJ9jaQc=; fh=EG1tZlVLfF4jTFZxkiwDmQ1uz6PI3oJp/v8hoXZNQaU=; b=CyyWfohLBCj3wmubOCm8ogf9WJ8ZHyDRFZnWpfOzj5o2U+iLGJIrLtIjRvkZWcOOK7 lIkYMm6Y/atu0maCuCgcXrFzMRqebJk3PvoUcanr6SlLlkkvyCZuBk0j2EG7wrlCQj7w eFqJUaUFpB1lJE6ZDm+936loLn1lqGTB4nL418fo+oXsWMEbXnD8rA0gNaxt6iOp1wKS QtlxLKygMhVJjQ/49RJhGuhhuDcmkA6Bc1ME/wWJqdj6VayJNimfASfw4k+z6iV1Ra+d +NXrMNc91N6Af52irj12UDJiy3/Cf0hlON6QKNcAJwdEa6K0ZsIJzXn1q2BTHrJn1n1s NAQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TNv1ay4i; spf=pass (google.com: domain of linux-ext4+bounces-65-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-65-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f35-20020a635123000000b00577fc59373fsi9367785pgb.296.2023.11.20.22.08.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 22:08:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-65-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TNv1ay4i; spf=pass (google.com: domain of linux-ext4+bounces-65-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-65-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A085B21E77 for ; Tue, 21 Nov 2023 06:08:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5CEE1E51F; Tue, 21 Nov 2023 06:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TNv1ay4i" X-Original-To: linux-ext4@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F99ECA; Mon, 20 Nov 2023 22:08:34 -0800 (PST) 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=Pu892CmklwtJGI+KPlhGZXprVPRFixMF2XsAMJ9jaQc=; b=TNv1ay4i6k4bYr6tnn5DCNpw+Q ozy8KZHfNl+IcuqxeLhubINYVHE+3b5nKzC2/R65RcNbQ9LjXJurLwuThPUhJryaZwmVrd1bbOpGQ Vi9QLk94ACENOPurhhZKqC/yftcc8PaA5tKnmLhJ3ZdQoVci1TB+wFERcg5tM57DNRb+4OJm4QB/s qLN8kU/rdoyaZdP0zqvDhmHCgmcydyEX+ZwJbVQ2xqBGF+UfBxRGEFX4Nt7JnJg6xdyJA/D2lpndn 2IVooUyKd+a8fNX0Vst0djFMbLMa3wwlnAs5W9PRlTYUixhIrtGTs1bsqcVT5xHUDcYWjlCK3Ykt5 KMdoM4jw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r5Jvz-00FkR4-2a; Tue, 21 Nov 2023 06:08:31 +0000 Date: Mon, 20 Nov 2023 22:08:31 -0800 From: Christoph Hellwig To: Ritesh Harjani Cc: Christoph Hellwig , linux-ext4@vger.kernel.org, Jan Kara , linux-fsdevel@vger.kernel.org Subject: Re: [RFC 2/3] ext2: Convert ext2 regular file buffered I/O to use iomap Message-ID: References: <874jhfy7i8.fsf@doe.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874jhfy7i8.fsf@doe.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, Nov 21, 2023 at 11:26:15AM +0530, Ritesh Harjani wrote: > > instantly spot anything that relies on them - you are just a lot more > > likely to hit an -ENOSPC from ->map_blocks now. > > Which is also true with existing code no? If the block reservation is > not done at the write fault, writeback is likely to fail due to ENOSPC? Yes. Not saying you should change this, I just want to make sure the iomap code handles this fine. I think it does, but I'd rather be sure. > Sure, make sense. Thanks! > I can try and check if the the wrapper helps. Let's wait until we have a few more conversions. > > Did yo run into issues in using the iomap based aops for the other uses > > of ext2_aops, or are just trying to address the users one at a time? > > There are problems for e.g. for dir type in ext2. It uses the pagecache > for dir. It uses buffer_heads and attaches them to folio->private. > ...it uses block_write_begin/block_write_end() calls. > Look for ext4_make_empty() -> ext4_prepare_chunk -> > block_write_begin(). > Now during sync/writeback of the dirty pages (ext4_handle_dirsync()), we > might take a iomap writeback path (if using ext2_file_aops for dir) > which sees folio->private assuming it is "struct iomap_folio_state". > And bad things will happen... Oh, indeed, bufferheads again. > Now we don't have an equivalent APIs in iomap for > block_write_begin()/end() which the users can call for. Hence, Jan > suggested to lets first convert ext2 regular file path to iomap as an RFC. Yes, no problem. But maybe worth documenting in the commit log.