]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: handle possible race as reshape completes.
authorNeilBrown <neilb@suse.com>
Fri, 24 Jul 2015 03:30:32 +0000 (13:30 +1000)
committerNeilBrown <neilb@suse.com>
Mon, 31 Aug 2015 17:38:59 +0000 (19:38 +0200)
commit56883feb8f6e94807b32dece8a35d3e3a06ce486
tree65d510b83cb87211dd53c636fe54c414df3015bd
parent220b65b1ccbcb8d46744e8f8552c6a01fd113ddc
md/raid5: handle possible race as reshape completes.

It is possible (though unlikely) for a reshape to be
interrupted between the time that end_reshape is called
and the time when raid5_finish_reshape is called.

This can leave conf->reshape_progress set to MaxSector,
but mddev->reshape_position not.

This combination confused reshape_request() when ->reshape_backwards.
As conf->reshape_progress is so high, it seems the reshape hasn't
really begun.  But assuming MaxSector is a valid address only
leads to sorrow.

So ensure reshape_position and reshape_progress both agree,
and add an extra check in reshape_request() just in case they don't.

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