gfs2: fix gfs2_find_jhead that returns jhead with seq 0
PATCH 1/1 gfs2: fix gfs2_find_jhead that returns 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() returns this to be the jhead, instead of seeking forward and looking further into the journal for a jhead with a higher sequence number.
Signed-off-by Abhi Das <[email protected]>
--- fs/gfs2/lops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/lops.c +1 -1
@@ -422,7 +422,7 @@ static bool gfs2_jhead_pg_srch(struct gfs2_jdesc *jd,for (offset =0 ; offset <PAGE_SIZE ; offset += sdp->sd_sb.sb_bsize) {if (!__get_log_header (sdp, kaddr + offset,0 , &lh)) { -if (lh.lh_sequence > head->lh_sequence) +if (lh.lh_sequence >= head->lh_sequence) *head = lh;else { ret = true;
Signature · 1 line
2.20.1