gfs2: Disable page faults during lockless buffered reads
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 14 Mar 2022 17:32:02 +0000 (18:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:57:24 +0000 (09:57 +0200)
commit8b2ea9a3a159fcdad4b22513be84189fc0db1666
treef700e31d13f2819f75ea18e6fb63183d6e539712
parent3fbccc4082c1a919c799df466af24479fcc0e216
gfs2: Disable page faults during lockless buffered reads

[ Upstream commit 52f3f033a5dbd023307520af1ff551cadfd7f037 ]

During lockless buffered reads, filemap_read() holds page cache page
references while trying to copy data to the user-space buffer.  The
calling process isn't holding the inode glock, but the page references
it holds prevent those pages from being removed from the page cache, and
that prevents the underlying inode glock from being moved to another
node.  Thus, we can end up in the same kinds of distributed deadlock
situations as with normal (non-lockless) buffered reads.

Fix that by disabling page faults during lockless reads as well.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/file.c