Re: [PATCH V4 10/12] block: call __bio_free in bio_endio

From: Christoph Hellwig
Date: Thu Jun 29 2017 - 16:22:58 EST


On Thu, Jun 29, 2017 at 11:35:44AM -0700, Shaohua Li wrote:
> > -
> > /* Auto-generate integrity metadata if this is a write */
> > if (bio_data_dir(bio) == WRITE)
> > bio_integrity_process(bio, bi->profile->generate_fn);
> > @@ -370,14 +364,12 @@ static void bio_integrity_verify_fn(struct work_struct *work)
> > struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
> >
> > bio->bi_status = bio_integrity_process(bio, bi->profile->verify_fn);
> > -
> > - /* Restore original bio completion handler */
> > - bio->bi_end_io = bip->bip_end_io;
> > + bio_integrity_free(bio);
> > bio_endio(bio);
>
> should we directly call bi_end_io here? Otherwise, looks reasonable to me.

We should call bio_endio to get the proper chaining behavior.