From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D78170 for ; Mon, 26 Jul 2021 08:19:45 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id BFDB567373; Mon, 26 Jul 2021 10:19:42 +0200 (CEST) Date: Mon, 26 Jul 2021 10:19:42 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christoph Hellwig , Dan Williams , Matthew Wilcox , Andreas Gruenbacher , Shiyang Ruan , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, nvdimm@lists.linux.dev, cluster-devel@redhat.com Subject: Re: [PATCH 16/27] iomap: switch iomap_bmap to use iomap_iter Message-ID: <20210726081942.GD14853@lst.de> References: <20210719103520.495450-1-hch@lst.de> <20210719103520.495450-17-hch@lst.de> <20210719170545.GF22402@magnolia> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719170545.GF22402@magnolia> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Jul 19, 2021 at 10:05:45AM -0700, Darrick J. Wong wrote: > > bno = 0; > > - ret = iomap_apply(inode, pos, blocksize, 0, ops, &bno, > > - iomap_bmap_actor); > > + while ((ret = iomap_iter(&iter, ops)) > 0) { > > + if (iter.iomap.type != IOMAP_MAPPED) > > + continue; > > There isn't a mapped extent, so return 0 here, right? We can't just return 0, we always need the final iomap_iter() call to clean up in case a ->iomap_end method is supplied. No for bmap having and needing one is rather theoretical, but people will copy and paste that once we start breaking the rules. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Mon, 26 Jul 2021 10:19:42 +0200 Subject: [Cluster-devel] [PATCH 16/27] iomap: switch iomap_bmap to use iomap_iter In-Reply-To: <20210719170545.GF22402@magnolia> References: <20210719103520.495450-1-hch@lst.de> <20210719103520.495450-17-hch@lst.de> <20210719170545.GF22402@magnolia> Message-ID: <20210726081942.GD14853@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Jul 19, 2021 at 10:05:45AM -0700, Darrick J. Wong wrote: > > bno = 0; > > - ret = iomap_apply(inode, pos, blocksize, 0, ops, &bno, > > - iomap_bmap_actor); > > + while ((ret = iomap_iter(&iter, ops)) > 0) { > > + if (iter.iomap.type != IOMAP_MAPPED) > > + continue; > > There isn't a mapped extent, so return 0 here, right? We can't just return 0, we always need the final iomap_iter() call to clean up in case a ->iomap_end method is supplied. No for bmap having and needing one is rather theoretical, but people will copy and paste that once we start breaking the rules.