gfs2: Fix duplicate should_fault_in_pages() call
authorBob Peterson <rpeterso@redhat.com>
Mon, 12 Jun 2023 17:26:23 +0000 (12:26 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:54 +0000 (16:21 +0200)
commit2e980eb9550d01d8d86b7bb29ab16a12fc57c6fa
treee36608300c6eaec32a291292409ffcbad0f7028b
parentf5d7f9e155175a099e47db40926cf82f46348bcc
gfs2: Fix duplicate should_fault_in_pages() call

[ Upstream commit c8ed1b35931245087968fd95b2ec3dfc50f77769 ]

In gfs2_file_buffered_write(), we currently jump from the second call of
function should_fault_in_pages() to above the first call, so
should_fault_in_pages() is getting called twice in a row, causing it to
accidentally fall back to single-page writes rather than trying the more
efficient multi-page writes first.

Fix that by moving the retry label to the correct place, behind the
first call to should_fault_in_pages().

Fixes: e1fa9ea85ce8 ("gfs2: Stop using glock holder auto-demotion for now")
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/file.c