From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Fri, 23 Dec 2022 23:22:31 -0800 Subject: [Cluster-devel] [RFC v3 2/7] iomap: Add iomap_folio_done helper In-Reply-To: References: <20221216150626.670312-1-agruenba@redhat.com> <20221216150626.670312-3-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.