]> 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)
commit77d7b2e48bc32ae83f20ee368343fa237e10834d
tree03b35cd01f2837299ab4856fc88cdb3ef5e8b05a
parentd2044c578bbeb80b821a71932348d05c4cb0a67d
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