Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5762231pxv; Wed, 21 Jul 2021 13:25:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcKVvHHrVxgA7ngksCJceC3CcxW9xkOcx6Bivum8XPUdXyi0kM64mmUajPmZqONCjKjF9k X-Received: by 2002:a92:7f04:: with SMTP id a4mr25009284ild.156.1626899136242; Wed, 21 Jul 2021 13:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626899136; cv=none; d=google.com; s=arc-20160816; b=q7X0FoB4Bfz5jSR5/PnHd172u5q8yspUKBJc3l5xgB87S5Wtn0lhZbr0dlU/I6cPz9 4BDbqK29b7BXQXpDYBLufjFVajZ2NgMWJ+FbJsqBeg90OwWU7mYDdO8r8SA8SZ6dRyYD 0HJo5p1nMQOZuXEPrN82lQalDiZjiRtVRrMXfXhKyiXRMwAsNvprUYws9Lekw1+KVxST +8/OFKYl8wQ3WO8YlL020r/vrZsHP27ff2UaCSLUxGGDrEyyATGkQkGfjjXiMaAQL4Qg OUI5w1DZ5LLaD7jIJKTzmTR/zfdsO2ojTCqyAVu7dtWu8KU5Bdd2TzBpPGzRfis6tv1x EOMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=jJTgBMXwThnuFAlDzExyHYWCk5DsYLxTDpEqi54da7Q=; b=TouGzn1knGidfWwJF4e2Ejy1LTejPbG4UCbQDAhtx4q9CTo2rtx/0vImx5w/IVPFIB 4f6ouqrxq+ry31tsDbyNB6xApCQBtzvp20M47RANtlob4x6w/yCZCcQsdwAdfy1SSzPh +4FcfXWuhYjYDXojKOfPAubIeOudttcB2vM1yC6jwZijesbnYSyVWm1UjScM1O3dXnGD tGMHcGZaYzX3FmhS7wi1vuepIwheV6angiukpUdMQ6e0tfGD0C7W7vtqlx9ToVKsWj2V ri0fsvSOe0+AS84k86gdTEVEu5VS+hUSuA2U7jEU/+R0e8M38MaXrL3mYMwwBYrIm828 my8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dYmsSM8J; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 187si27256960iow.86.2021.07.21.13.25.24; Wed, 21 Jul 2021 13:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dYmsSM8J; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbhGUSO2 (ORCPT + 99 others); Wed, 21 Jul 2021 14:14:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30717 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbhGUSO1 (ORCPT ); Wed, 21 Jul 2021 14:14:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626893703; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jJTgBMXwThnuFAlDzExyHYWCk5DsYLxTDpEqi54da7Q=; b=dYmsSM8JqA/TQ6k30JybIhVZwlfxa04/EpXhMvM75RIgf8YRrap2H/HmimryA3TWrjWWBw iyCmosMWT9o+wpPsua4ElzVv7Rm1WgBM8FY06ef4MXAuZ+dyDsV5vsvmw9jtPudaQWQcvv rwOLCJEfuV14vq90Lk2Cz7esNaRrqWc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-_zwGKJtQPgywbHz1n30GUA-1; Wed, 21 Jul 2021 14:55:02 -0400 X-MC-Unique: _zwGKJtQPgywbHz1n30GUA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8567F2B6; Wed, 21 Jul 2021 18:54:59 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-112-62.rdu2.redhat.com [10.10.112.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id D744F5D740; Wed, 21 Jul 2021 18:54:52 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <162687506932.276387.14456718890524355509.stgit@warthog.procyon.org.uk> <162687511125.276387.15493860267582539643.stgit@warthog.procyon.org.uk> To: Jeff Layton Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, "Matthew Wilcox (Oracle)" , Anna Schumaker , Steve French , Dominique Martinet , Mike Marshall , David Wysochanski , Shyam Prasad N , Miklos Szeredi , Linus Torvalds , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 03/12] netfs: Remove netfs_read_subrequest::transferred MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <298116.1626893692.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 21 Jul 2021 19:54:52 +0100 Message-ID: <298117.1626893692@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Jeff Layton wrote: > The above two deltas seem like they should have been in patch #2. Yeah. Looks like at least partially so. > > @@ -635,15 +625,8 @@ void netfs_subreq_terminated(struct netfs_read_su= brequest *subreq, > > goto failed; > > } > > = > > - if (WARN(transferred_or_error > subreq->len - subreq->transferred, > > - "Subreq overread: R%x[%x] %zd > %zu - %zu", > > - rreq->debug_id, subreq->debug_index, > > - transferred_or_error, subreq->len, subreq->transferred)) > > - transferred_or_error =3D subreq->len - subreq->transferred; > > - > > subreq->error =3D 0; > > - subreq->transferred +=3D transferred_or_error; > > - if (subreq->transferred < subreq->len) > > + if (iov_iter_count(&subreq->iter)) > > goto incomplete; > > = > = > I must be missing it, but where does subreq->iter get advanced to the > end of the current read? If you're getting rid of subreq->transferred > then I think that has to happen above, no? For afs, afs_req_issue_op() points fsreq->iter at the subrequest iterator = and calls afs_fetch_data(). Thereafter, we wend our way to afs_deliver_fs_fetch_data() or yfs_deliver_fs_fetch_data() which set call->iter to point to that iterator and then call afs_extract_data() whic= h passes it to rxrpc_kernel_recv_data(), which eventually passes it to skb_copy_datagram_iter(), which advances the iterator. For the cache, the subrequest iterator is passed to the cache backend by netfs_read_from_cache(). This would be cachefiles_read() which calls vfs_iocb_iter_read() which I thought advances the iterator (leastways, filemap_read() keeps going until iov_iter_count() reaches 0 or some other = stop condition occurs and doesn't thereafter call iov_iter_revert()). David