]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid10: always initialise ->state on newly allocated r10_bio
authorNeilBrown <neilb@suse.de>
Mon, 18 Aug 2014 04:38:45 +0000 (14:38 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 19 Aug 2014 07:20:27 +0000 (17:20 +1000)
commit3b56bb909f94298b43ba2f949b3ce394016cb675
tree64adaf3e9ef304cf078e9c64940a0c24a44641b4
parent7c8e6529c8edf374c3ccb9f9a318d3efce20b1ec
md/raid10: always initialise ->state on newly allocated r10_bio

Most places which allocate an r10_bio zero the ->state, some don't.
As the r10_bio comes from a mempool, and the allocation function uses
kzalloc it is often zero anyway.  But sometimes it isn't and it is
best to be safe.

I only noticed this because of the bug fixed by an earlier patch
where the r10_bios allocated for a reshape were left around to
be used by a subsequent resync.  In that case the R10BIO_IsReshape
flag caused problems.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c