]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: Even more gfs2_find_jhead fixes
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 26 May 2020 18:11:51 +0000 (20:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:41:50 +0000 (16:41 +0200)
commitcbdbc0f66190561df3473b468e5834b1fef38e72
tree5eb35efb8a3243805cfa4a9b3e3d2298cdd761e9
parent3a5837c692918c229baf63fe7950965d27c48ac2
gfs2: Even more gfs2_find_jhead fixes

[ Upstream commit 20be493b787cd581c9fffad7fcd6bfbe6af1050c ]

Fix several issues in the previous gfs2_find_jhead fix:
* When updating @blocks_submitted, @block refers to the first block block not
  submitted yet, not the last block submitted, so fix an off-by-one error.
* We want to ensure that @blocks_submitted is far enough ahead of @blocks_read
  to guarantee that there is in-flight I/O.  Otherwise, we'll eventually end up
  waiting for pages that haven't been submitted, yet.
* It's much easier to compare the number of blocks added with the number of
  blocks submitted to limit the maximum bio size.
* Even with bio chaining, we can keep adding blocks until we reach the maximum
  bio size, as long as we stop at a page boundary.  This simplifies the logic.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/lops.c