lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2021-06-01 07:48    [W:0.170 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site