The Write On An Origin Of A Snapshot
Sending I/O to a device for which we have a snapshot:
- If the start sector of the I/O belongs to a chunk that is found in the
exceptions table, just perform a normal write to the origin volume.
- Otherwise, if there's a pending copy of this chunk, place the I/O on
the chunk's queue.
- Otherwise (this is the first write for this chunk), look for a free
entry in the exceptions table.
- If there were no free entries, mark this snapshot as invalid (since it is
full), and return an I/O error.
- If there was a free entry, assign it to our chunk, and send a copy
request to the kcopyd kernel-daemon.
- When the copy was complete, update the entry in the exceptions table,
perform the original I/O and all other I/Os that might have gotten queued
for this chunk.
Originally written by
guy keren