Messages in this thread | | | From | Linus Torvalds <> | Date | Mon, 31 May 2021 19:47:28 -1000 | Subject | Re: [RFC 9/9] gfs2: Fix mmap + page fault deadlocks (part 2) |
| |
On Mon, May 31, 2021 at 7:02 AM Andreas Gruenbacher <agruenba@redhat.com> wrote: > > @@ -807,13 +824,20 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to, > [...] > ret = iomap_dio_rw(iocb, to, &gfs2_iomap_ops, NULL, 0); > gfs2_glock_dq(gh); > + if (unlikely(current_needs_retry())) { > + set_current_needs_retry(false); > + if (ret == -EFAULT && > + !iov_iter_fault_in_writeable(to, PAGE_SIZE)) > + goto retry; > + }
Hmm. I haven't walked through this all, but is that "ret == -EFAULT" test the right thing to do?
Can iomap_dio_rw() not instead just return a partial success if it hit a missing page half-way?
Shouldn't you retry for that case too?
Linus
| |