Whamcloud - gitweb
LU-14924 osd-ldiskfs: fix T10PI verify/generate_fn
authorLi Dongyang <dongyangli@ddn.com>
Tue, 10 Aug 2021 13:20:13 +0000 (23:20 +1000)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 22 Sep 2021 03:26:10 +0000 (03:26 +0000)
commit2c505bbb84b6bd1ae7d59b3cefb86a1b018ad5b3
tree76cb783dbb0101d20e9b22463570a5fe0014c5d7
parentd5495c6c284234dd4812fba8abdca163ee4b1821
LU-14924 osd-ldiskfs: fix T10PI verify/generate_fn

We are making wrong assumptions in the verify/generate_fn
of T10PI.

Consider this case: we have 4 pages lnb[0-3] in osd_iobuf.
lnb[2] is mapped to a hole, so it won't be added to bio.
If lnb[3] happens to be contiguous after lnb[1], lnb[3] will
be added to bio, with a bi_idx of 2.
In the verify/generate_fn, we work out which niobuf_local
to feed the guard tags to using bi_idx and obp_start_page_idx
and we will end up with wrong niobuf and set the guard tags
for lnb[2].

Contiguous blocks in bio doesn't necessarily mean we are looking
at contiguous niobuf_local/lnb in osd_iobuf->dr_lnbs

Lustre-change: https://review.whamcloud.com/44548
Lustre-commit: 92fc8708a2d5b20e317a2cec97056c752a8b7bd4

Test-Parameters: env=ONLY=77n testlist=sanity
Change-Id: I1ea1b6498692044e680c8754cd31e2c2b7bc9539
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44941
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osd-ldiskfs/osd_integrity.c
lustre/osd-ldiskfs/osd_io.c
lustre/tests/sanity.sh