md/raid5 revise rules for when to update metadata during reshape
authorNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 04:28:40 +0000 (15:28 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 04:28:40 +0000 (15:28 +1100)
commitc8f517c444e4f9f55b5b5ca202b8404691a35805
treee679ae13a07e1a2644da0dfc4a4d66bf73f83626
parentb0f9ec047b79a92e8b8a9dfbf97537c8fbef234a
md/raid5 revise rules for when to update metadata during reshape

We currently update the metadata :
 1/ every 3Megabytes
 2/ When the place we will write new-layout data to is recorded in
    the metadata as still containing old-layout data.

Rule one exists to avoid having to re-do too much reshaping in the
face of a crash/restart.  So it should really be time based rather
than size based.  So change it to "every 10 seconds".

Rule two turns out to be too harsh when restriping an array
'in-place', as in that case the metadata much be updates for every
stripe.
For the in-place update, it can only possibly be safe from a crash if
some user-space program data a backup of every e.g. few hundred
stripes before allowing them to be reshaped.  In that case, the
constant metadata update is pointless.
So only update the metadata if the new metadata will report that the
end of the 'old-layout' data is beyond where we are currently
writing 'new-layout' data.

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