Messages in this thread | | | From | Daniel Phillips <> | Subject | Re: [PATCH] 3/5: Device-mapper: snapshots | Date | Sat, 3 Jul 2004 01:30:02 -0400 |
| |
On Wednesday 02 June 2004 14:06, Andi Kleen wrote: > Alasdair G Kergon <agk@redhat.com> writes: > > + > > +/*----------------------------------------------------------------- > > + * Persistent snapshots, by persistent we mean that the snapshot > > + * will survive a reboot. > > + *---------------------------------------------------------------*/ > > Is this target supposed to be crash safe? What happens when > the computer crashes while writing to such a volume? > > I suppose it would need barriers for that at least, which it doesn't > seem to use.
Hi Andi,
Please pardon the one month lag, I must bug Zack about getting Kernel Traffic out faster ;)
It is designed to be crash-safe:
- Each snapshot exception is logged to disk by overwriting the last sector of a grow-only list of snapshot exceptions.
- Write completion is not handed back up the chain until:
- the data to be overwritten has been copied to a new exception - the new exception has been logged to the snapshot store as above
As far as I can see, the concept is leak-proof, except for being sensitive to random garbage in the last few sector writes. I suspect that doesn't happen on modern disk drives. If it does, I hope somebody will shout.
I am not sure what you mean about barriers, perhaps you were thinking of synchronous waiting. This snapshot driver does wait for completions, but it pipelines the waits so throughput is not affected much (snapshot overhead is dominated by copyouts).
Incidently, there is an entirely new snapshot design coming down the pipe that uses a more traditional, journalling design to achieve the necessary hardware-like durability.
Regards,
Daniel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |