]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix mmap + page fault deadlocks for direct I/O
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 12 Jul 2021 11:40:38 +0000 (13:40 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Oct 2021 06:42:14 +0000 (08:42 +0200)
commitabf38fee5113e5bc7f4fbbf9cc87ad3da33141b3
tree03b35cd01f2837299ab4856fc88cdb3ef5e8b05a
parent9f5d3bb0acfa16282b79894e0887b12b5e1c0ca1
gfs2: Fix mmap + page fault deadlocks for direct I/O

Also disable page faults during direct I/O requests and implement a
similar kind of retry logic as in the buffered I/O case.

The retry logic in the direct I/O case differs from the buffered I/O
case in the following way: direct I/O doesn't provide the kinds of
consistency guarantees between concurrent reads and writes that buffered
I/O provides, so once we lose the inode glock while faulting in user
pages, we always resume the operation.  We never need to return a
partial read or write.

This locking problem was originally reported by Jan Kara.  Linus came up
with the idea of disabling page faults.  Many thanks to Al Viro and
Matthew Wilcox for their feedback.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/file.c