Thread (22 messages) 22 messages, 2 authors, 2021-07-26

Re: [RFC PATCH 03/12] netfs: Remove netfs_read_subrequest::transferred

From: David Howells <dhowells@redhat.com>
Date: 2021-07-21 18:55:06
Also in: ceph-devel, linux-cifs, linux-fsdevel, linux-nfs, lkml

Jeff Layton [off-list ref] wrote:
The above two deltas seem like they should have been in patch #2.
Yeah.  Looks like at least partially so.
quoted
@@ -635,15 +625,8 @@ void netfs_subreq_terminated(struct netfs_read_subrequest *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 = subreq->len - subreq->transferred;
-
 	subreq->error = 0;
-	subreq->transferred += 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() which
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help