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 X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E942C636CA for ; Wed, 21 Jul 2021 18:55:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF79D60FDA for ; Wed, 21 Jul 2021 18:55:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF79D60FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6488B6B005D; Wed, 21 Jul 2021 14:55:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 61F8A6B006C; Wed, 21 Jul 2021 14:55:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 535696B0070; Wed, 21 Jul 2021 14:55:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 39E066B005D for ; Wed, 21 Jul 2021 14:55:07 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DC5A525F5D for ; Wed, 21 Jul 2021 18:55:06 +0000 (UTC) X-FDA: 78387497412.15.B58F15A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 775315003D7F for ; Wed, 21 Jul 2021 18:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626893705; 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=LjJYNclyexq7u1cGkCwxBHRzCVaqJercPGWCYlnWzdJ082gnEVJGC72fyirZFuxH4YEwLu 73+k3lwJlNfVkKyDjnQ7f0tWBMPm+N7Gny0380OrNs9Zj8E/tcpb+8JnNx+vGxMJQKxtVs Rj1CjxCR3PGVTT1hfLxOl2g6iSYLHHQ= 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 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 775315003D7F X-Stat-Signature: ex5dbuhgcwiosqk9j7ynyfyqmarcd6d7 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LjJYNcly; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of dhowells@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=dhowells@redhat.com X-HE-Tag: 1626893706-738450 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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