Re: How to convert I/O iterators to iterators, sglists and RDMA lists

From: David Howells
Date: Fri Nov 04 2022 - 14:48:38 EST


David Howells <dhowells@xxxxxxxxxx> wrote:

> > What protects pages involved in ITER_XARRAY iterator created by
> > afs_read_dir()? Note that we are not guaranteed inode_lock() on
> > the directory in question...
>
> Yeah - that needs fixing. The size of the data can change, but I don't update
> the iterator.

Actually, no. The iterator is the output buffer for afs_fetch_data(). If the
buffer turned out to be too small we drop the validate_lock and go round and
try again.

req->actual_len and req->file_size are updated by afs_fetch_data() from the
RPC reply. req->len tells the RPC delivery code how big the buffer is (which
we don't have to fill if there's less data available than we have buffer
space).

David