-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
3
-
9223372036854775807
osd_dif_generate() and osd_dif_verify() (lustre/osd-ldiskfs/osd_integrity.c) take the client guards for a bio integrity segment from lnb->lnb_guards[0], whatever the segment's offset in its page (bv_offset). osd_bio_integrity_compare() does the same. tgt_checksum_niobuf_t10pi() sets lnb_guard_rpc for full-page writes whose checksum type matches the device's T10 type, so those guards are used.
When a bio segment starts in the middle of a page, the sectors after that point get the guards of the start of the page. Depending on whether the device checks guards on write, the write then fails with a protection error, or a later read fails verification.
This can only happen with PAGE_SIZE larger than the filesystem block size (64 KiB pages with 4 KiB blocks, aarch64 or ppc64le servers), a T10-PI capable device and the client T10 guards in use. osd_do_bio() starts a bio in the middle of a page after a transaction restart in the middle of a page (dr_start_pg_wblks) or at a gap in the disk blocks inside a page.
A fix would offset the guard pointer by offset_in_page(data_buf) / interval for the segment (and the same in verify and compare), or fall back to computing the guard when the segment does not start the page.
Found while reviewing https://review.whamcloud.com/c/fs/lustre-release/+/69823 (LU-20994), which could have added a third way to start a bio in the middle of a page (a RAID row cut). That patch now never cuts a row that starts inside a page.
- is related to
-
LU-20994 osd-ldiskfs: end bios on RAID row boundaries
-
- Open
-