linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs checksum
@ 2014-05-01  4:16 Jan Kasiak
  2014-05-01 15:17 ` Chris Mason
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kasiak @ 2014-05-01  4:16 UTC (permalink / raw)
  To: linux-btrfs

Is there a design/technical reason behind btrfs using checksums
separately per block, versus checksumming into a merkle tree?

Where I'm coming from: there's a Linux kernel device mapper module
called dm-verity, which let's you verify the contents of a block
device using a merkle tree (at mount time you provide the root hash).
For my project, I'm modifying the module to enable write support, but
in order to maintain consistency in the event of a power failure, I
have to do the equivalent of data journaling to a circular log (so I
end up writing data twice).

Where I'm going with this: I've been looking into what improvements
could be made if this were implemented at the filesystem level, and
btrfs looks like a good candidate. But it already has a checksumming
scheme, which is incompatible with a merkle tree, and would be
redundant if a merkle tree would be implemented as well. (zfs has a
merkle tree, but from what I can tell, it doesn't expose the root hash
to the user)

What the example use case is: you want to detect malicious data
tampering across the entire file system, so at mount time you provide
the merkle tree root hash. You get back an updated version of the root
hash when you unmount, which you store in a secure place until the
next time you mount the filesystem. You can detect if anyone modifies
your data in between mounts, and also if they modify the underlying
storage while the filesystem is mounted.

Thanks,
-Jan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-01 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01  4:16 btrfs checksum Jan Kasiak
2014-05-01 15:17 ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).