4 ms·
> When a CoW filesystem writes to a block of data or metadata, it first makes a copy of it Is this a really a precise description? I was sure that (for data) t
by viraptor 9y ago
> When a CoW filesystem writes to a block of data or metadata, it first makes a copy of it
Is this a really a precise description? I was sure that (for data) the actual copy only happens in case of a block with multiple references. If there was a single use of a block I expected it to be modified in place in most real-world filesystems. Summary from wikipedia seems to confirm that.
Am I missing something, or is that just unfortunate wording?
What they describe with the write of the data followed with write of the indexes as new elements seems more like a log filesystem.
- barrkel 9y agoAlways copying is what ZFS does as far as I know - so that the final write on raidz can be a pointer swap at the top of the tree.
- ghusbands 9y agoIt's an implementation detail that can and does go either way in many real world systems, depending on the technologies involved.
- wmf 9y agoNo, the copy is generally done every time. In-place writes cause all kinds of problems with atomicity, ordering, torn writes, etc. Also, for ZFS/btrfs/bcachefs style filesystems the pointer contains a checksum of the block and thus it needs to be updated on every write.
- aidenn0 9y agoCoW stands for "Copy on Write" a system that updates blocks in-place is not is not CoW.
- viraptor 9y agoThere's lots of things which are called copy on write, where CoW means really copy-on-deduplication-otherwise-update-in-place. Like qcow2 filesystem. Or Cow type in Rust.