Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-14 Thread Johannes Thumshirn
On Fri, May 10, 2019 at 01:45:47PM +, Chris Mason wrote: > I'm a little concerned about about btrfs_csum_data() and > btrfs_csum_final() below. We're using two different > SHASH_DESC_ON_STACK() and then overwriting internals (shash_desc_ctx()) > with the assumption that whatever we're doing

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-13 Thread David Sterba
On Mon, May 13, 2019 at 03:01:11PM +0200, Johannes Thumshirn wrote: > On Mon, May 13, 2019 at 03:00:03PM +0200, David Sterba wrote: > > On Fri, May 10, 2019 at 01:15:44PM +0200, Johannes Thumshirn wrote: > > > Currently btrfs_csum_data() relied on the crc32c() wrapper around the > > > crypto > > >

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-13 Thread Chris Mason
On 13 May 2019, at 3:17, Johannes Thumshirn wrote: > On Fri, May 10, 2019 at 01:54:30PM +, Chris Mason wrote: >> Looking at the callers of btrfs_csum_final() and btrfs_csum_data(), >> lets >> just pass the shash_desc from the callers. That way you don't have >> to >> poke at memcpy and shas

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-13 Thread Johannes Thumshirn
On Mon, May 13, 2019 at 03:00:03PM +0200, David Sterba wrote: > On Fri, May 10, 2019 at 01:15:44PM +0200, Johannes Thumshirn wrote: > > Currently btrfs_csum_data() relied on the crc32c() wrapper around the crypto > > framework for calculating the CRCs. > > > > As we have our own crypto_shash struc

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-13 Thread David Sterba
On Fri, May 10, 2019 at 01:15:44PM +0200, Johannes Thumshirn wrote: > Currently btrfs_csum_data() relied on the crc32c() wrapper around the crypto > framework for calculating the CRCs. > > As we have our own crypto_shash structure in the fs_info now, we can > directly call into the crypto framewor

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-13 Thread Johannes Thumshirn
On Fri, May 10, 2019 at 01:54:30PM +, Chris Mason wrote: > Looking at the callers of btrfs_csum_final() and btrfs_csum_data(), lets > just pass the shash_desc from the callers. That way you don't have to > poke at memcpy and shash_desc_ctx(). I wanted to avoid spreading knowledge about the

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-10 Thread Chris Mason
On 10 May 2019, at 9:45, Chris Mason wrote: > On 10 May 2019, at 7:15, Johannes Thumshirn wrote: > >> Currently btrfs_csum_data() relied on the crc32c() wrapper around the >> crypto >> framework for calculating the CRCs. >> >> As we have our own crypto_shash structure in the fs_info now, we can

Re: [PATCH 14/17] btrfs: directly call into crypto framework for checsumming

2019-05-10 Thread Chris Mason
On 10 May 2019, at 7:15, Johannes Thumshirn wrote: > Currently btrfs_csum_data() relied on the crc32c() wrapper around the > crypto > framework for calculating the CRCs. > > As we have our own crypto_shash structure in the fs_info now, we can > directly call into the crypto framework without goin