[OpenAFS-devel] Re: Linux readpage handler

Simon Wilkinson sxw@inf.ed.ac.uk
Thu, 26 May 2011 18:00:25 +0100


On 26 May 2011, at 17:46, Andrew Deason wrote:
> It's not immediately clear to me how even modern Linux handles this,
> though. Say, for example, a callback break comes in between those =
calls
> and invalidates the pages; would the call to truncate_inode_pages or
> whatever block until the write finishes (from some Linux lock), or =
would
> filemap_copy_from_user (or whatever the modern analogue is) return an
> error that causes the operation to be retried or something?

I haven't verified this, but my reading of the write code path suggests =
that iov_iter_copy_from_user_atomic() will only copy data that is =
available and we'll go round the loop in generic_perform_write(), =
firstly paging in the data, then beginning the write, until we can copy =
all of the requested data. So I would hope that this isn't an issue on =
modern systems.

Cheers,

Simon.