Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp723630ybb; Fri, 20 Mar 2020 07:07:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu7ovslEbqqihNQJ9srL3XiMrfUUi6OSoMGyY+oBvQJFnxQDAXMlJwijc2whqmTaPpASJmx X-Received: by 2002:a9d:6e90:: with SMTP id a16mr6884239otr.72.1584713226065; Fri, 20 Mar 2020 07:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584713226; cv=none; d=google.com; s=arc-20160816; b=AuNOWUeuNC/H7dTqskVQ5eQvax55qZORawn/8X9d5tMbjbLmv4r9ENQsjJ1GBwiW2J rrqyFBWvFt1m3Iy0UQJPW84YWxbAvlkZJDSUReblLHgJJvRu2JtVCElbcdi1WFHFA5sL Rr+O08+GcOlgtDVUu10pq/ru4fK267lE3nYCYkRlN8ewNhoW3Wv478AP1w8RQFerJGIc o2NaUf5g3wODFLjr2Ic4cvugEeT5qOqjeXxLyIeMbBf7qmkHRwNUco2Q2bKP0uaU7iS3 bbeZoLYKOv1O4VGwWfJ3o+3ppsO4KJixMMorRduq9UlsBw8zN1pTJTdsqcB1e0ZWO9rR e/Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n/bVoNnai1Z8EXWktYzvjCdfjvG9IjTbEvaQWdguc00=; b=HjqqSt7NrDKoB2IcVvwjBwhUPedQRoqawusRySe3zevz4sSIotDhoN7rfQeoshMHWR Qu2pjeCZ85qqwIEnUUutawMo9tJjr5gOcW+nBWZCQrnMIpd121KQzBcVQRwUGl+NpZm9 PNxyXo404ja0UAkM2hOz5PqOEtDFVi8mj8pu21Tu9XUVO6jR2xMGgkaNC5vjdVQDEbyV r0rEiSmSfSkufZ4pqqpIx5/dLKzutOT4BiERNKGt9N7PuAXvYntRuw69nhYeK5vpg5b/ z3cyuVqVRYEX/SjMm+V1a6Z+XlpHwCkozo1FF6BVbjcw5yaukhLTY6sg+J28dD3aQx+l AOJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KGA9sdjQ; 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 z16si3624967otj.5.2020.03.20.07.06.36; Fri, 20 Mar 2020 07:07:06 -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=KGA9sdjQ; 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 S1726880AbgCTOFk (ORCPT + 99 others); Fri, 20 Mar 2020 10:05:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52268 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgCTOFk (ORCPT ); Fri, 20 Mar 2020 10:05:40 -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; bh=n/bVoNnai1Z8EXWktYzvjCdfjvG9IjTbEvaQWdguc00=; b=KGA9sdjQ6eq6QDNOVK8h4ctiJ1 /gV7+CS9MAOMaFFmpVVrRlxA2A1cNVTAH9Sq5UJPx/qrYuBmi1Cn0SvgaJ9d4i3ro7AOicxt8v2t4 RFWU+EulSXyA+okLM07zYfw4iM+Y5zW5srrU+S2L6xBeL5TXTsDCeAVmB2Ka1HEqzbb8NhjYostj4 +iautOBEwNfRV1kHmqzd5AeLbM0CYkK5fanTBby5q9JQHfRWJVf2vAPyXSQbayIfL6e5U+wLDCp8h XuAiN304YJULVS0U4+uWWstaw97IsQcQ/+N9AJcUOANkwXJYfhC/KB2FU1ES0mz6wp6FFLAe+e6c2 Ic9Q557A==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jFIHK-0002Cq-37; Fri, 20 Mar 2020 14:05:38 +0000 Date: Fri, 20 Mar 2020 07:05:38 -0700 From: Christoph Hellwig To: Goldwyn Rodrigues Cc: linux-fsdevel@vger.kernel.org, riteshh@linux.ibm.com, linux-ext4@vger.kernel.org, hch@infradead.org, darrick.wong@oracle.com, willy@infradead.org, linux-btrfs@vger.kernel.org, Josef Bacik Subject: Re: [PATCH v2] iomap: return partial I/O count on error in iomap_dio_bio_actor Message-ID: <20200320140538.GA27895@infradead.org> References: <20200319150805.uaggnfue5xgaougx@fiona> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200319150805.uaggnfue5xgaougx@fiona> 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 I spent a fair amount of time looking over this change, and I am starting to feel very bad about it. iomap_apply() has pretty clear semantics of either return an error, or return the bytes processed, and in general these semantics work just fine. The thing that breaks this concept is the btrfs submit_bio hook, which allows the file system to keep state for each bio actually submitted. But I think you can simply keep the length internally in btrfs - use the space in iomap->private as a counter of how much was allocated, pass the iomap to the submit_io hook, and update it there, and then deal with the rest in ->iomap_end. That assumes ->iomap_end actually is the right place - can someone explain what the expected call site for __endio_write_update_ordered is? It kinda sorta looks to me like something that would want to be called after I/O completion, not after I/O submission, but maybe I misunderstand the code.