]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: fix gfs2_find_jhead that returns uninitialized jhead with seq 0
authorAbhi Das <adas@redhat.com>
Tue, 4 Feb 2020 20:14:56 +0000 (14:14 -0600)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 6 Feb 2020 16:35:23 +0000 (17:35 +0100)
commitc46592899801a0481ca9230b979f82b095ab2be5
treebbff92297065efcbdfd7795b8a28a0f54ceb4c14
parentb392f556ff4ee92a460b2b34adee50d13a6b52bb
gfs2: fix gfs2_find_jhead that returns uninitialized jhead with seq 0

When the first log header in a journal happens to have a sequence
number of 0, a bug in gfs2_find_jhead() causes it to prematurely exit,
and return an uninitialized jhead with seq 0. This can cause failures
in the caller. For instance, a mount fails in one test case.

The correct behavior is for it to continue searching through the journal
to find the correct journal head with the highest sequence number.

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