Whamcloud - gitweb
LU-16712 cksum: fix generating T10PI guard tags for partial brw page 40/50540/3
authorLi Dongyang <dongyangli@ddn.com>
Wed, 5 Apr 2023 02:54:13 +0000 (12:54 +1000)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 May 2023 07:07:22 +0000 (07:07 +0000)
commit3999627447c01eebd96c14cc5cf8bba93f89a66b
tree057168b988217cea01744101e0acb0223acb9be0
parent97d29eb800e8d9faba04f0744376cb50b239e2e9
LU-16712 cksum: fix generating T10PI guard tags for partial brw page

To get better performance, we allocate a page as the buffer for
T10PI guard tags, we fill the buffer going over every page for brw,
when the buffer is considered full, we use
cfs_crypto_hash_update_page() to update the hash and reuse the buffer.

It doesn't work when there's a page in the brw gets clipped, and the
checksum sector size is 512. For a page with PAGE_SIZE of 4096,
and offset at 1024, we will end up with 6 guard tags, and won't have
enough space in the very end of the buffer for a full brw page, which
needs 8.

Work out the number of guard tags for each page, update the
checksum hash and reuse the buffer when needed.

Change-Id: Ic591e63b24534f2a42b670669520895cb35a9546
Fixes: b1e7be00cb ("LU-10472 osc: add T10PI support for RPC checksum")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50540
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c
lustre/target/tgt_handler.c