Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1596393rwj; Fri, 23 Dec 2022 23:39:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXEBlbV4h7Gl/dHZNLXnQtsEpIEmHf5lvcm9Q6KYr7G2BZVc569jh573UKmgT1jen1THhN X-Received: by 2002:a17:90a:b804:b0:219:a00e:545a with SMTP id n4-20020a17090ab80400b00219a00e545amr12984645pjr.39.1671867551133; Fri, 23 Dec 2022 23:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671867551; cv=none; d=google.com; s=arc-20160816; b=mIWYSUBxwHmGKRJCyQifGGYsM4tapnFuRpnAhFlehTbF25mcEAqYIrzC8gyT/Pe1hh 4aXyVtGRaJl4gWGEAiJvyIg56xGft+4o1fvjN+ltM0E4ZdJHZzG2zho9j/+13NedyQSA Ivlxj1BdRNabhUwdDxcgvioUxI7UD6JEAfDpi59LXGd7+2CHGop+qyWIxe7QchRYt+JV lbee4XYeWS92W2Q3No+qwC7Edg+ucoc1oFzqwN+RMdhHdMt6FGMfd2Xm9B2DYyitRi2P K5pK7S7s9zqAwbTkUAYEjWU0bgucyxEXAE6eq/PW1rsjqtu+BNI62dnpHsQrD2/M8EVr fI/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Fi47Fpyh+tJbjf8+uKyHTOeyVTr+BeFruENq8fY4qs=; b=RksCZNxDjLTTD/+8T27wT0qIk74kQMP1AzO5NDJJMohxT2pf6XLFCge+UfhNFNaHKR T2IgIY9xqbInGA5mTMuIOIb123qRlhRXn6nMFqKg9JEr+jdTQhxHyYfgPPWevu7HerdL 1spfblJdptEsQvIwOXnl7n9xCNL9f85BhZi+PoeLFQOO7cu2WwrY5XyAb+ZsO9jQo6Ss yC+kp4Ufdkc2U6NRvi8TiY1nv092D70ZVMntFVLqZDW2IswI6CUVazwMHg0rPb4wwm5J X9PE4h8Bj5plXbzb4L8tLrRnoMd8BLObRDliqsmSeJYRTdXSFAcOGZzWAYpvGaOM2kC5 VJKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eolPUk9U; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg14-20020a17090b1e0e00b0021929c63260si6039449pjb.8.2022.12.23.23.38.55; Fri, 23 Dec 2022 23:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eolPUk9U; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbiLXHWj (ORCPT + 99 others); Sat, 24 Dec 2022 02:22:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiLXHWi (ORCPT ); Sat, 24 Dec 2022 02:22:38 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F5612AC8; Fri, 23 Dec 2022 23:22:38 -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-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=2Fi47Fpyh+tJbjf8+uKyHTOeyVTr+BeFruENq8fY4qs=; b=eolPUk9U/R6vmIQCoVczaYs7fk QhgUm85n7w5YcHJyovsz5seV1/zp/K/bp6z9kanXjJZR70xGI6cmhxl4SN0h6lxrv3dj/Ert81SWC fKiCXm3kVxWfeHI8DryYJli15AzHcStujfcp7HbJIV9W0RsvGa0AuFnHAJyO0k+dB+m1gMxVnxGl/ 3LqQGs+yeIWXbPTla19zBjUd2pwPmnkLHLvSaqZ7pGe8w5B5iF6D6sZ3ZMVYb4QUnVTC1IXRuf4ik atZuI4uR+AmEpvE+F1dWuXW+6TZz6vnAYIy6ChIe9MQlA/soTskZXjyxHOnuNXpMBUg6Yz+ywdHDI +MIz6AIA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p8yrX-00FvxT-9f; Sat, 24 Dec 2022 07:22:31 +0000 Date: Fri, 23 Dec 2022 23:22:31 -0800 From: Christoph Hellwig To: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= Cc: Christoph Hellwig , Andreas Gruenbacher , "Darrick J . Wong" , Alexander Viro , Matthew Wilcox , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com Subject: Re: [RFC v3 2/7] iomap: Add iomap_folio_done helper Message-ID: References: <20221216150626.670312-1-agruenba@redhat.com> <20221216150626.670312-3-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 23, 2022 at 09:54:34PM +0100, Andreas Gr?nbacher wrote: > > But for the current version I don't really understand why the error > > unwinding changes here. > > Currently, we have this order of operations in iomap_write_begin(): > > folio_unlock() // folio_put() // iomap_write_failed() // ->page_done() > > and this order in iomap_write_end(): > > folio_unlock() // ->page_done() // folio_put() // iomap_write_failed() > > The unwinding in iomap_write_begin() works because this is the trivial > case in which nothing happens to the page. We might just as well use > the same order of operations there as in iomap_write_end() though, and > when you switch to that, this is what you get. Please document this in the commit message.