Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4733579rwl; Mon, 3 Apr 2023 08:54:51 -0700 (PDT) X-Google-Smtp-Source: AKy350ZyWGIFhENddNjUv4fA9xsM0msQCc4TLMJn7DB2UIGRh1lm+DtBdYhNvdNUb4EAy8vQ34w8 X-Received: by 2002:a17:907:1707:b0:922:ae30:3c23 with SMTP id le7-20020a170907170700b00922ae303c23mr36220398ejc.18.1680537290825; Mon, 03 Apr 2023 08:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680537290; cv=none; d=google.com; s=arc-20160816; b=N4EoWR0TTv+jeT8gpF+PZybNeMwqsVfUMA2mPzw7AhICYQnhObvXbJEr8o9Mwts73k 8nvinCKRQcAQwsNtVdsWmPf2wj/OYzmDShnaImvgFfT8ZIHDsHd0oPagpCKfW3BmLvtx H0BnvkEpleGAUBMYqoskQX25WKHnHCPHdgEni1J33FhzVqoEAtGDn6Cjz2ydb6oMn/YM 067AacwpvYzJun3bmuRLYE0TEyax8v34obaHF1hEPLr80FM/nvHC6yGHUoo8lIVaRXcr onBKkNU4MSL665jqB0Y+hAeRmbGriY8wYEh9L2/PtfsIbMe7lP7HzZb8JpbSoOHeCBCB 4/4g== 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-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=g2gJhk2EudPdDf1rhN0+Yqo19FdGtI3AE5kQt4njseU=; b=ZDgJCXrE3of6Sh8xqXB6L83OAyWQw+z4I2m5xutG7ejFQ5BiQ8V5X5T5NnxAgkw9iJ 09Hr4H6DgAcBpFF87LY8guf0fr3DutTzhpBEDisv6okOzLS1SDZwg9wdp/cMJOIIYjPp Hu7/zMxP3m9bmE0fI48n30eHPPIWPwOvBvucqvpyXFKFSV68PphCRyMUI04LAI2QRuTS tismtoM4qoqCCtatw8cnfN/ukM5edE9/FQJyhldJYTGUOG7qMLsZmfbj1T9KWVRcRX3q SeOe6kVvScHmuEaEkBYRSlRP/o0GEFT/+htmzJbgkOlxkAh4+rS6oU/fpXpaxu0yia+G ohYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xvC3EoZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a170906388400b00931038178ecsi6563149ejd.330.2023.04.03.08.54.26; Mon, 03 Apr 2023 08:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linux.dev header.s=key1 header.b=xvC3EoZp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232584AbjDCPxG (ORCPT + 99 others); Mon, 3 Apr 2023 11:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233075AbjDCPwt (ORCPT ); Mon, 3 Apr 2023 11:52:49 -0400 Received: from out-31.mta0.migadu.com (out-31.mta0.migadu.com [91.218.175.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96B0448B for ; Mon, 3 Apr 2023 08:52:21 -0700 (PDT) Date: Mon, 3 Apr 2023 11:51:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680537095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=g2gJhk2EudPdDf1rhN0+Yqo19FdGtI3AE5kQt4njseU=; b=xvC3EoZpCjRIKJSK/hMwRQRQLoIWADFK/Lxj5KYc3TL23GHTWhquFpjxEiiIy/Ch8MjEuw MwwFvPIR7ofTcOYm5vwb8vNmt1FJzlw8x3sfWJD8pdQaZ9Y6G6yDyGciA0PezYCox2paBw EflYNGdHo2WjJQYRlkhAE5h/kg318tU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Christoph Hellwig 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: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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-kernel@vger.kernel.org On Mon, Apr 03, 2023 at 08:13:21AM -0700, Christoph Hellwig wrote: > 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. It should be folded in, but it's logically the same assert (advance past the end of the iter) so not worth the increased code size.