Shaohua Li 5f9d1fde7d raid5: fix memory leak of bio integrity data
Yi reported a memory leak of raid5 with DIF/DIX enabled disks. raid5
doesn't alloc/free bio, instead it reuses bios. There are two issues in
current code:
1. the code calls bio_init (from
init_stripe->raid5_build_block->bio_init) then bio_reset (ops_run_io).
The bio is reused, so likely there is integrity data attached. bio_init
will clear a pointer to integrity data and makes bio_reset can't release
the data
2. bio_reset is called before dispatching bio. After bio is finished,
it's possible we don't free bio's integrity data (eg, we don't call
bio_reset again)
Both issues will cause memory leak. The patch moves bio_init to stripe
creation and bio_reset to bio end io. This will fix the two issues.

Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
2016-08-24 10:21:52 -07:00
..
2016-06-07 13:41:38 -06:00
2014-01-14 23:23:03 -05:00
2016-07-01 10:53:21 -04:00
2016-07-28 17:38:16 -07:00
2016-06-07 13:41:38 -06:00
2016-07-20 17:37:01 -06:00
2016-06-07 13:41:38 -06:00
2016-07-28 17:38:16 -07:00
2016-07-28 17:38:16 -07:00
2016-07-20 23:49:50 -04:00
2016-07-28 17:38:16 -07:00
2016-07-20 17:37:01 -06:00
2016-07-28 17:38:16 -07:00
2016-07-20 23:49:49 -04:00
2016-01-20 13:52:20 -08:00
2016-08-24 10:21:50 -07:00
2015-08-13 12:31:57 -06:00