Neil Brown wrote:
On Monday January 19, davidsen@xxxxxxx wrote:
Neil Brown wrote:
The difficulty is "How do you handle a crash?"
If you crash and restart in the middle of a reshape, you need to know
where all the data is.
To follow your scheme, you would need to update the metadata for
every block that is moved.
That would seem to be an issue doing it in a large task as well, if I
understand what you want to do. After the data have been written to the
spare space I believe you are going to write it back. If you update the
metadata before the write and something happens you have old metadata
but data in another format. Conversely, if you update the metadata
first, and something happens, you have the metadata describing a change
which didn't happen. So You would have to have a metadata reflecting the
data not being in the array, but actually somewhere else, or you would
have to keep the spare space inside the array, where room might not be
available.
I "freeze" a section of the array so that any writes block,
I copy that data to somewhere safe, and mark that copy as being a
valid copy of the moved data.
Then I copy it back in the new layout and update the array metadata to
show that the change-over point between old-layout and new-layout has
changed. Then I invalidate the copy.
Then repeat.
When restarting an array, mdadm checks the copy (which could be in a
file on a different device) and if it is valid, it is copied on to
the array and the metadata is updated.
Sounds good...
--
Bill Davidsen <davidsen@xxxxxxx>
"Woe unto the statesman who makes war without a reason that will still
be valid when the war is over..." Otto von Bismark
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html