Commit ee1ecd7e authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Carlos Llamas
Browse files

UPSTREAM: gfs2: Fix mmap + page fault deadlocks for direct I/O



commit b01b2d72 upstream

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: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 640a6be8)
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: If3f5d03e2a87c1e74a0a304225c3eb9a756c2872
parent 127a8ed2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment