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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89A92CD98ED for ; Thu, 18 Jun 2026 07:16:15 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4ggsTV09YLz2xM7; Thu, 18 Jun 2026 17:16:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=113.46.200.226 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1781766973; cv=none; b=YKyzdxDFbu5lN+vIWCMfD652X4x/gHnTC0KGnftnFeORv/KNi1TY1jaHmY0u4y1L2lW6kyOMb8YPxxrpLUCCczElaFs98xjqWp51QKU+WQoFMDQ6+BlxyGSsxWnosO3+W8kKECcc5w9jvk2owcb69IvVa+PW7O4CRcv3m+1ARpRZqFUcpwoFa3wZVCAk92SeCP2RS1tyalJhLmZR8qj7DPEfa9CMp/6E+/AWjbhu080xUJSqvSltbTTFVzE+Glx/hqwrWr2IcmkgCIbZTydD8zR6eJ2JDrVAWQrNjiEVwo2mPZpFaic3mVjmSUT4+X2EPTDZ1uJ9gKYCQh9zA0aK5Q== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1781766973; c=relaxed/relaxed; bh=iVdMWBlT662SrcMGF8y/JgT1w7kd5zj4BN+nKS7wNos=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=U+tSLQeb72F3N/7ZS6vIp3ADvakwVLzY+++wlPRrzTg5H1Ar1NdwLcEl5pPDR7Tn3tFNszWj9dx9vY68UB7i9m5unGHAEl+WAHQtpSFRKT9UIDXGaX/DptZM/YHWMbMsKztd4JD1TqI4ULsEhbUOuWx0w1Gl1gMoDVbjjf8df+w/EGCSDOCt3AJ0/3besOIK+7E9EuD+BACTkwcujYasJXMvlP6Lu02gvTKKdIyT/jBpUYEfemiv1YV4l+uGrKb4WAZZDQCXFLb/hniI7Np3XPsFXvic16I16/j6u4tG7JywwURZMnbLQJozO36z10fov1YKd2WQD7Jb3R5j9Z7q4g== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=R9JyEAlP; dkim-atps=neutral; spf=pass (client-ip=113.46.200.226; helo=canpmsgout11.his.huawei.com; envelope-from=zhaoyifan28@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=R9JyEAlP; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=113.46.200.226; helo=canpmsgout11.his.huawei.com; envelope-from=zhaoyifan28@huawei.com; receiver=lists.ozlabs.org) Received: from canpmsgout11.his.huawei.com (canpmsgout11.his.huawei.com [113.46.200.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4ggsTR3rFbz2xLm for ; Thu, 18 Jun 2026 17:16:09 +1000 (AEST) dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=iVdMWBlT662SrcMGF8y/JgT1w7kd5zj4BN+nKS7wNos=; b=R9JyEAlPmRphrW7FCV665S9w6GTNpkK1q8uUkDLokTNRvccCAjTIQHD4qtCa8uKgEFtAfitt6 BakpTY9xfKqLembS9Ixw3nAcypVhIoTw5yAEgsGsHtCuQI9HjjiJmZoE0emPodtX/pU4o6OSaoz 9fYw46eICuzrTpIRzynliaQ= Received: from mail.maildlp.com (unknown [172.19.162.92]) by canpmsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4ggsJ26R11zKm4B; Thu, 18 Jun 2026 15:08:02 +0800 (CST) Received: from kwepemr100010.china.huawei.com (unknown [7.202.195.125]) by mail.maildlp.com (Postfix) with ESMTPS id 7042540562; Thu, 18 Jun 2026 15:16:04 +0800 (CST) Received: from [100.102.28.251] (100.102.28.251) by kwepemr100010.china.huawei.com (7.202.195.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Thu, 18 Jun 2026 15:16:03 +0800 Message-ID: Date: Thu, 18 Jun 2026 15:16:03 +0800 X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: don't merge bios over iomap boundaries, was: Re: [PATCH] erofs: prevent buffered read bio merges across device chunks To: Christoph Hellwig , Gao Xiang CC: , , , , , Ritesh Harjani , "Darrick J. Wong" , , Joanne Koong References: <20260612033244.993507-1-zhaoyifan28@huawei.com> <58bef9af-0926-4948-b917-e38c3793f596@linux.alibaba.com> From: "zhaoyifan (H)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [100.102.28.251] X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemr100010.china.huawei.com (7.202.195.125) Hi Christoph, This patch works well under my workload (at least correctness-wise). Thanks. Tested-by: Yifan Zhao Thanks, Yifan On 2026/6/12 14:25, Christoph Hellwig wrote: > On Fri, Jun 12, 2026 at 11:42:38AM +0800, Gao Xiang wrote: >>> Reported-by: Kelu Ye >>> Assisted-by: Codex:GPT-5.5 >>> Signed-off-by: Yifan Zhao >> I think it's an iomap bug instead, see: >> >> iomap_bio_read_folio_range(), we should fix iomap instead. > Yes. iomap should not try to build bios over iomap boundaries. > caused various issues. Ritesh ran into that with the ext2 port > back in the day, and I actually ran into it again with an under > development xfs feature. > > Can you try this patch? > > --- > From 297230cc3c08cbfef3670b08c4e35813c18c523e Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Sun, 7 Jun 2026 08:53:20 +0200 > Subject: iomap: submit read bio after each extent > > This keeps bios from crossing RTG boundaries in XFS and probably fixes > all kinds of other stuff.. > > Signed-off-by: Christoph Hellwig > --- > fs/iomap/buffered-io.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index d55b936e6986..3642a11c102f 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -597,12 +597,13 @@ void iomap_read_folio(const struct iomap_ops *ops, > > trace_iomap_readpage(iter.inode, 1); > > - while ((ret = iomap_iter(&iter, ops)) > 0) > + while ((ret = iomap_iter(&iter, ops)) > 0) { > iter.status = iomap_read_folio_iter(&iter, ctx, > &bytes_submitted); > - > - if (ctx->read_ctx && ctx->ops->submit_read) > - ctx->ops->submit_read(&iter, ctx); > + if (ctx->read_ctx && ctx->ops->submit_read) > + ctx->ops->submit_read(&iter, ctx); > + ctx->read_ctx = NULL; > + } > > if (ctx->cur_folio) > iomap_read_end(ctx->cur_folio, bytes_submitted); > @@ -664,12 +665,13 @@ void iomap_readahead(const struct iomap_ops *ops, > > trace_iomap_readahead(rac->mapping->host, readahead_count(rac)); > > - while (iomap_iter(&iter, ops) > 0) > + while (iomap_iter(&iter, ops) > 0) { > iter.status = iomap_readahead_iter(&iter, ctx, > &cur_bytes_submitted); > - > - if (ctx->read_ctx && ctx->ops->submit_read) > - ctx->ops->submit_read(&iter, ctx); > + if (ctx->read_ctx && ctx->ops->submit_read) > + ctx->ops->submit_read(&iter, ctx); > + ctx->read_ctx = NULL; > + } > > if (ctx->cur_folio) > iomap_read_end(ctx->cur_folio, cur_bytes_submitted);