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

2017-06-29 Thread Christoph Hellwig
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_verif

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

2017-06-29 Thread Shaohua Li
On Thu, Jun 29, 2017 at 07:15:52PM +0200, Christoph Hellwig wrote: > On Wed, Jun 28, 2017 at 02:42:49PM -0700, Shaohua Li wrote: > > > bio_integrity_endio -> bio_integrity_verify_fn -> bio_integrity_process > > > access the integrity data, so I don't think this works as-is. > > > > oh, I probably

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

2017-06-29 Thread Christoph Hellwig
On Wed, Jun 28, 2017 at 02:42:49PM -0700, Shaohua Li wrote: > > bio_integrity_endio -> bio_integrity_verify_fn -> bio_integrity_process > > access the integrity data, so I don't think this works as-is. > > oh, I probably missed the integrity endio. could we let > bio_integrity_verify_fn > free in

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

2017-06-28 Thread Shaohua Li
On Wed, Jun 28, 2017 at 11:29:08PM +0200, Christoph Hellwig wrote: > On Wed, Jun 28, 2017 at 09:30:00AM -0700, Shaohua Li wrote: > > From: Shaohua Li > > > > bio_free isn't a good place to free cgroup/integrity info. There are a > > lot of cases bio is allocated in special way (for example, in st

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

2017-06-28 Thread Christoph Hellwig
On Wed, Jun 28, 2017 at 09:30:00AM -0700, Shaohua Li wrote: > From: Shaohua Li > > bio_free isn't a good place to free cgroup/integrity info. There are a > lot of cases bio is allocated in special way (for example, in stack) and > never gets called by bio_put hence bio_free, we are leaking memory

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

2017-06-28 Thread Shaohua Li
From: Shaohua Li bio_free isn't a good place to free cgroup/integrity info. There are a lot of cases bio is allocated in special way (for example, in stack) and never gets called by bio_put hence bio_free, we are leaking memory. This patch moves the free to bio endio, which should be called anywa