]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: More gfs2_find_jhead fixes
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 27 Apr 2020 23:15:41 +0000 (01:15 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 8 May 2020 13:15:12 +0000 (15:15 +0200)
commitb42bbf89ba90e7022ebe1c90cb9ca554ec014e99
treeaf08b77d81b99274741281a46fc6e2b495948781
parent6248bab1288a10a2f54f5efe2912a0a5cf4e6fcc
gfs2: More gfs2_find_jhead fixes

It turns out that when extending an existing bio, gfs2_find_jhead fails to
check if the block number is consecutive, which leads to incorrect reads for
fragmented journals.

In addition, limit the maximum bio size to an arbitrary value of 2 megabytes:
since commit 8b6e6b8a207f ("block: enable multipage bvecs"), if we just keep
adding pages until bio_add_page fails, bios will grow much larger than useful,
which pins more memory than necessary with barely any additional performance
gains.

Fixes: c6e8ce55661f ("gfs2: read journal in large chunks")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/lops.c