Re: Do we need to unrevert "fs: do not prefault sys_write() user buffer pages"?
From: Al Viro
Date: Tue Jun 22 2021 - 11:28:08 EST
On Tue, Jun 22, 2021 at 04:20:40PM +0100, David Howells wrote:
> and wondering if the iov_iter_fault_in_readable() is actually effective. Yes,
> it can make sure that the page we're intending to modify is dragged into the
> pagecache and marked uptodate so that it can be read from, but is it possible
> for the page to then get reclaimed before we get to
> iov_iter_copy_from_user_atomic()? a_ops->write_begin() could potentially take
> a long time, say if it has to go and get a lock/lease from a server.
Yes, it is. So what? We'll just retry. You *can't* take faults while holding
some pages locked; not without shitloads of deadlocks.