From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B611BC761A6 for ; Mon, 3 Apr 2023 15:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbjDCPN0 (ORCPT ); Mon, 3 Apr 2023 11:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjDCPNY (ORCPT ); Mon, 3 Apr 2023 11:13:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E409D; Mon, 3 Apr 2023 08:13:23 -0700 (PDT) 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=B7kXOVNKKiYGm55LmYo0xLWWOBNIP+Mr/6zTfTQhP4Y=; b=Gt8/CIKy93b4Mx86hSubZHEeFl +7LgmPyqg45dIbDO94knccQIb8oGwFp2IWCL16yWJnKaOxe3cqzf9iS5VK4btn1wDSB/SfPB4vyaa cw+hRDSbkXTftd4AQus1hdriDCjc9labIJEbRzJQrYmDZrHo+ZKMu7e1zhrUpd+MIGaTR10Js2Skw 7NSdOgAKWyZ4NaXWDsciHiAQktdcPsBEX+fGlyqQiTH8uXySChIVHrsPkxpjK6t5MmyLdK/0SUk9c BL0gY3XnNJOFPzGe2hCYr5E1NEkDH7VlDUeGS8Qsiuj5YjQxAu1KHuetUeEs9nlsNY8gkfIe+rMdU OlmPBKpg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pjLs1-00FkUU-2f; Mon, 03 Apr 2023 15:13:21 +0000 Date: Mon, 3 Apr 2023 08:13:21 -0700 From: Christoph Hellwig To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, willy@infradead.org, axboe@kernel.dk Subject: Re: [PATCH 2/2] block: Rework bio_for_each_folio_all() Message-ID: References: <20230327174402.1655365-1-kent.overstreet@linux.dev> <20230327174402.1655365-3-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230327174402.1655365-3-kent.overstreet@linux.dev> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 27, 2023 at 01:44:02PM -0400, Kent Overstreet wrote: > + bio_for_each_folio_all(fv, bio, iter) > + iomap_finish_folio_read(fv.fv_folio, fv.fv_offset, fv.fv_len, error); Please avoid the overly long lines. Also if we pass all arguments of the folio_vec we might as ell just pass that folio_vec anyway. > - BUG_ON(iter->idx > bio->bi_vcnt || (iter->idx == bio->bi_vcnt && iter->done)); > + BUG_ON(iter->idx > bio->bi_vcnt || > + (iter->idx == bio->bi_vcnt && iter->done)); Seems like this should be folded into the previous patch. Also I generally prefer to avoid top-level || in asserts and just do multiple asserts, as that shows which condition triggered.