Whamcloud - gitweb
LU-16712 cksum: fix generating T10PI guard tags for partialbrw
authorLi Dongyang <dongyangli@ddn.com>
Wed, 5 Apr 2023 02:54:13 +0000 (12:54 +1000)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 26 May 2023 10:20:37 +0000 (10:20 +0000)
commit1d14ebfd6bf05e6bf4f84e2576cf961b88da25ec
treeed8a363b43443ad6186f78cfc38f778970e3cb21
parent82a51498a781a9bf2907d73f29b7eba03211e0d7
LU-16712 cksum: fix generating T10PI guard tags for partialbrw

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.

Lustre-change: https://review.whamcloud.com/50540
Lustre-commit: 3999627447c01eebd96c14cc5cf8bba93f89a66b

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