Not to nit-pick... but what being described is the behavior of a log-structured file system (of which WAFL is one). There are many other implementations of log-structured file systems.
IMO, calling that copy-on-write is dead-wrong, not merely confusing. There's no copy going on. The inode file is copied (checkpointed) when a snapshot is initiated, not when a write occurs.
Just my two cents... Paul
Here is some more basic commentary for the newbies ...
By "checkpointed" I don't think that Paul is implying that the entire inode file is copied. It is handled just like any other file, i.e., only blocks that have changed are replaced with new blocks. Blocks containing unchanged data are not replaced. And as Paul points out, the inode file is only updated when WAFL writes a consistency point (snapshot).
WAFL never disturbs the blocks that comprise the current consistency point when writing a new C.P. Should the filer crash or lose power in the middle of writing the new C.P., the old C.P. is still intact. And WAFL keeps a log in NVRAM of all write requests since that last C.P. To recover, WAFL simply reverts to the most recent C.P. and replays the NVRAM log.
When a read request arrives over the net, WAFL tries to satisfy it using filesystem data cached in RAM. If the data isn't in RAM, then it is read from disk and cached in RAM.
When a write request arrives over the net, WAFL logs it in NVRAM. WAFL also updates the filesystem RAM cache, which makes the newly written data immediately available for reading. But WAFL waits awhile before committing the write to disk.
Once enough writes have accumulated in NVRAM, or 10 seconds has elapsed since the last C.P., WAFL emits a burst of writes to the disks, generating a new C.P. The committed write requests are cleared from the NVRAM log. If you ever watch the disk drive lights on a moderately loaded filer, you will notice that about every 10 seconds there is a flurry of activity. This is a new C.P. being written.
Steve Losen scl@virginia.edu phone: 804-924-0640
University of Virginia ITC Unix Support