On Sat, Oct 31, 2020 at 10:00:02AM +0100, Christoph Hellwig wrote: > + if (mapping->host->i_blkbits <= PAGE_SHIFT && > + mapping->a_ops->is_partially_uptodate && > + !iov_iter_is_pipe(iter) && > + trylock_page(page)) { > + loff_t pos = max(iocb->ki_pos, (loff_t)pg_index << PAGE_SHIFT); I think the cure is worse than the disease here ;-) Fortunately, I simplified this here: https://git.infradead.org/users/willy/pagecache.git/commitdiff/c6b5b2540b6db91d3c8928c8ed1b5d72a402215a by getting the page lock earlier (or dropping the reference to the page, waiting for it to become unlocked and starting the lookup again)