tests: add test for vdev_disk page alignment check

This provides a test driver and a set of test vectors for the page
alignment check callback function vdev_disk_check_pages_cb().

Because there's no good facility for exposing this function to a
userspace test right now, for now I'm just duplicating the function and
adding commentary to remind people to keep them in sync.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16076
This commit is contained in:
Rob Norris
2024-04-10 11:19:50 +10:00
committed by Brian Behlendorf
parent 44f337be30
commit bc27c49404
6 changed files with 435 additions and 0 deletions
+6
View File
@@ -853,6 +853,11 @@ BIO_END_IO_PROTO(vbio_completion, bio, error)
* pages) but we still have to ensure the data portion is correctly sized and
* aligned to the logical block size, to ensure that if the kernel wants to
* split the BIO, the two halves will still be properly aligned.
*
* NOTE: if you change this function, change the copy in
* tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c, and add test
* data there to validate the change you're making.
*
*/
typedef struct {
uint_t bmask;
@@ -863,6 +868,7 @@ typedef struct {
static int
vdev_disk_check_pages_cb(struct page *page, size_t off, size_t len, void *priv)
{
(void) page;
vdev_disk_check_pages_t *s = priv;
/*