summaryrefslogtreecommitdiff
path: root/Documentation/ntb.txt
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-08-22 21:14:01 -0700
committerShaohua Li <shli@fb.com>2016-08-24 10:21:52 -0700
commit5f9d1fde7d54a5d5fd8cccbee9c9c31474fcdcf2 (patch)
tree928efbe6ba6efef4e84eed37103038015770614a /Documentation/ntb.txt
parent27028626b4b9022dcac23688e09ea43b36e1183c (diff)
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>
Diffstat (limited to 'Documentation/ntb.txt')
0 files changed, 0 insertions, 0 deletions