Skip to content

[VDO-6064] dm vdo test: fix torn write tests#435

Merged
lorelei-sakai merged 2 commits intodm-vdo:mainfrom
lorelei-sakai:test/fix-torn-write-tests
Apr 1, 2026
Merged

[VDO-6064] dm vdo test: fix torn write tests#435
lorelei-sakai merged 2 commits intodm-vdo:mainfrom
lorelei-sakai:test/fix-torn-write-tests

Conversation

@lorelei-sakai
Copy link
Copy Markdown
Member

@lorelei-sakai lorelei-sakai commented Mar 26, 2026

Pass dory-specific parameters to dory devices when they are created. This is generalized to allow passing parameters specific to other device types as well, although that features is not currently used by any other device types.

This change makes the torn write tests once again function the way they were intended, by allowing the tests to set the blockSize and cacheBlocks parameters on their dory devices again. Then, fix the dory cache bio handling to actually be able to send bios to the underlying device correctly. This makes the torn write tests pass again even with the cache enabled.

Also added some minor refactoring to clarify the code a bit.

Comment thread src/perl/vdotest/VDOTest.pm
Comment thread src/perl/dmtest/DMTest.pm
@lorelei-sakai lorelei-sakai changed the title [VDO-6064] dm vdo test: fix torn write test setup [VDO-6064] dm vdo test: fix torn write tests Mar 31, 2026
Pass dory-specific parameters to dory devices when they are created.
This is generalized to allow passing parameters specific to other
device types as well, although that features is not currently used
by any other device types.

This change makes the torn write tests once again function the way
they were intended, by allowing the tests to set the blockSize
and cacheBlocks parameters on their dory devices again.

Also refactor the parameter collection slightly to make clear that
the provided extra parameters will override any other parameters.

Signed-off-by: Matthew Sakai <msakai@redhat.com>
Remove calls to dm_submit_bio_remap() and replace them with
calls to submit_bio_noacct(). I believe this change was
copied from similar upstream changes such as a92512819b1f
("dm thin: use dm_submit_bio_remap"), without realizing
that dm_submit_bio_remap() can only be used with cloned
bios. Due to the test issues around dory parameter setting,
I believe that we have never actually used this code since
it was added. (This effectivey reverts the change that
added this call around four years ago.)

Also fix a few parameters so that cache bios can contain a
data page (so that bio_add_page() will succeed), and replace
the bio offset calculation with the offset_in_page() macro.
(The calculation is identical.)

Signed-off-by: Matthew Sakai <msakai@redhat.com>
Copy link
Copy Markdown
Member

@bjohnsto bjohnsto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@lorelei-sakai lorelei-sakai merged commit 4a127ca into dm-vdo:main Apr 1, 2026
7 checks passed
@lorelei-sakai lorelei-sakai deleted the test/fix-torn-write-tests branch April 1, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants