All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/13] Add support for SHA-256 checksums
@ 2019-05-16  8:47 Johannes Thumshirn
  2019-05-16  8:47 ` [PATCH v2 01/13] btrfs: use btrfs_csum_data() instead of directly calling crc32c Johannes Thumshirn
                   ` (12 more replies)
  0 siblings, 13 replies; 28+ messages in thread
From: Johannes Thumshirn @ 2019-05-16  8:47 UTC (permalink / raw)
  To: David Sterba
  Cc: Linux BTRFS Mailinglist, Chris Mason, Richard Weinberger,
	David Gstir, Nikolay Borisov, Johannes Thumshirn

This patchset add support for adding new checksum types in BTRFS.

Currently BTRFS only supports CRC32C as data and metadata checksum, which is
good if you only want to detect errors due to data corruption in hardware.

But CRC32C isn't able cover other use-cases like de-duplication or
cryptographically save data integrity guarantees.

The following properties made SHA-256 interesting for these use-cases:
- Still considered cryptographically sound
- Reasonably well understood by the security industry
- Result fits into the 32Byte/256Bit we have for the checksum in the on-disk
  format
- Small enough collision space to make it feasible for data de-duplication
- Fast enough to calculate and offloadable to crypto hardware via the kernel's
  crypto_shash framework.

The patchset also provides mechanisms for plumbing in different hash
algorithms relatively easy.

Unfortunately this patchset also partially reverts commit: 
9678c54388b6 ("btrfs: Remove custom crc32c init code")

This is an intermediate submission, as a) mkfs.btrfs support is still missing
and b) David requested to have three hash algorithms, where 1 is crc32c, one
cryptographically secure and one in between.

Johannes Thumshirn (13):
  btrfs: use btrfs_csum_data() instead of directly calling crc32c
  btrfs: resurrect btrfs_crc32c()
  btrfs: use btrfs_crc32c{,_final}() in for free space cache
  btrfs: don't assume ordered sums to be 4 bytes
  btrfs: dont assume compressed_bio sums to be 4 bytes
  btrfs: format checksums according to type for printing
  btrfs: add common checksum type validation
  btrfs: check for supported superblock checksum type before checksum
    validation
  btrfs: Simplify btrfs_check_super_csum() and get rid of size
    assumptions
  btrfs: add boilerplate code for directly including the crypto
    framework
  btrfs: directly call into crypto framework for checsumming
  btrfs: remove assumption about csum type form
    btrfs_print_data_csum_error()
  btrfs: add sha256 as another checksum algorithm

 fs/btrfs/Kconfig                |   3 +-
 fs/btrfs/btrfs_inode.h          |  33 +++++++--
 fs/btrfs/check-integrity.c      |  12 ++--
 fs/btrfs/compression.c          |  40 +++++++----
 fs/btrfs/compression.h          |   2 +-
 fs/btrfs/ctree.h                |  28 +++++++-
 fs/btrfs/disk-io.c              | 146 ++++++++++++++++++++++++++--------------
 fs/btrfs/disk-io.h              |   2 -
 fs/btrfs/extent-tree.c          |   6 +-
 fs/btrfs/file-item.c            |  38 ++++++-----
 fs/btrfs/free-space-cache.c     |  10 ++-
 fs/btrfs/inode.c                |  20 ++++--
 fs/btrfs/ordered-data.c         |  13 ++--
 fs/btrfs/ordered-data.h         |   4 +-
 fs/btrfs/scrub.c                |  39 ++++++++---
 fs/btrfs/send.c                 |   2 +-
 include/uapi/linux/btrfs_tree.h |   6 +-
 17 files changed, 275 insertions(+), 129 deletions(-)

-- 
2.16.4


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

end of thread, other threads:[~2019-05-22  8:06 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16  8:47 [PATCH v2 00/13] Add support for SHA-256 checksums Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 01/13] btrfs: use btrfs_csum_data() instead of directly calling crc32c Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 02/13] btrfs: resurrect btrfs_crc32c() Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 03/13] btrfs: use btrfs_crc32c{,_final}() in for free space cache Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 04/13] btrfs: don't assume ordered sums to be 4 bytes Johannes Thumshirn
2019-05-21 12:42   ` Nikolay Borisov
2019-05-21 13:10   ` Johannes Thumshirn
2019-05-21 13:14     ` Nikolay Borisov
2019-05-16  8:47 ` [PATCH v2 05/13] btrfs: dont assume compressed_bio " Johannes Thumshirn
2019-05-21 12:56   ` Nikolay Borisov
2019-05-21 13:00     ` Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 06/13] btrfs: format checksums according to type for printing Johannes Thumshirn
2019-05-16  8:47 ` [PATCH v2 07/13] btrfs: add common checksum type validation Johannes Thumshirn
2019-05-21 14:04   ` David Sterba
2019-05-16  8:47 ` [PATCH v2 08/13] btrfs: check for supported superblock checksum type before checksum validation Johannes Thumshirn
2019-05-21 12:58   ` Nikolay Borisov
2019-05-21 14:06   ` David Sterba
2019-05-16  8:47 ` [PATCH v2 09/13] btrfs: Simplify btrfs_check_super_csum() and get rid of size assumptions Johannes Thumshirn
2019-05-21 13:01   ` Nikolay Borisov
2019-05-21 13:23     ` Johannes Thumshirn
2019-05-16  8:48 ` [PATCH v2 10/13] btrfs: add boilerplate code for directly including the crypto framework Johannes Thumshirn
2019-05-21 14:11   ` David Sterba
2019-05-16  8:48 ` [PATCH v2 11/13] btrfs: directly call into crypto framework for checsumming Johannes Thumshirn
2019-05-21 14:22   ` David Sterba
2019-05-22  8:06     ` Johannes Thumshirn
2019-05-16  8:48 ` [PATCH v2 12/13] btrfs: remove assumption about csum type form btrfs_print_data_csum_error() Johannes Thumshirn
2019-05-21 13:02   ` Nikolay Borisov
2019-05-16  8:48 ` [PATCH v2 13/13] btrfs: add sha256 as another checksum algorithm Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.