]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid10: Fix memory leak when raid10 reshape completes.
authorNeilBrown <neilb@suse.de>
Mon, 18 Aug 2014 03:59:50 +0000 (13:59 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 19 Aug 2014 07:20:27 +0000 (17:20 +1000)
commitd76beb4aad72844935fdfa9aded359d65bf40a7b
tree673ef59fc7051a80e3047378da2d43f074b83a3e
parentc099b9239fd6ee4aa7fcc4d32081d35023956bd7
md/raid10: Fix memory leak when raid10 reshape completes.

When a raid10 commences a resync/recovery/reshape it allocates
some buffer space.
When a resync/recovery completes the buffer space is freed.  But not
when the reshape completes.
This can result in a small memory leak.

There is a subtle side-effect of this bug.  When a RAID10 is reshaped
to a larger array (more devices), the reshape is immediately followed
by a "resync" of the new space.  This "resync" will use the buffer
space which was allocated for "reshape".  This can cause problems
including a "BUG" in the SCSI layer.  So this is suitable for -stable.

Cc: stable@vger.kernel.org (v3.5+)
Fixes: 2b22b1bc80d3b25b016efed0d52858d2df2f953f
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c