]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 16 Mar 2020 11:27:27 +0000 (12:27 +0100)
commitad35c4bc977bbc839262148754960f7f8923eac0
tree66edbc463871b942556f45edfe2bc38b7a7e91aa
parentaebd3096a269c365f1e54d97c2f7c3df506cd4b4
gfs2: fix gfs2_find_jhead that returns uninitialized jhead with seq 0

BugLink: https://bugs.launchpad.net/bugs/1867051
commit 7582026f6f3588ecebd281965c8a71aff6fb6158 upstream.

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: f4686c26ecc3 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/gfs2/lops.c