Skip to content

Commit 08ca56f

Browse files
author
Andreas Gruenbacher
committed
gfs2: gfs2_chain_bio start sector fix
Pass the start sector into gfs2_chain_bio(): the new bio isn't necessarily contiguous with the previous one. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 4a94f05 commit 08ca56f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/gfs2/lops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,13 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index,
479479
}
480480

481481
static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs,
482-
blk_opf_t opf)
482+
sector_t sector, blk_opf_t opf)
483483
{
484484
struct bio *new;
485485

486486
new = bio_alloc(prev->bi_bdev, nr_iovecs, opf, GFP_NOIO);
487487
bio_clone_blkg_association(new, prev);
488-
new->bi_iter.bi_sector = bio_end_sector(prev);
488+
new->bi_iter.bi_sector = sector;
489489
bio_chain(new, prev);
490490
submit_bio(prev);
491491
return new;
@@ -548,7 +548,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
548548
unsigned int blocks =
549549
(PAGE_SIZE - off) >> bsize_shift;
550550

551-
bio = gfs2_chain_bio(bio, blocks,
551+
bio = gfs2_chain_bio(bio, blocks, sector,
552552
REQ_OP_READ);
553553
goto add_block_to_new_bio;
554554
}

0 commit comments

Comments
 (0)