-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix decrypt_fault.ksh when zfs_abd_scatter_enabled=0 #17233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
For context, if we change arc_buf to take abd instead of normal buffer. We can allow buffer sharing even without turning off scatter abd. In which case this change is needed regardless of scatter abd being disabled or not. |
Buffer sharing may happen for small blocks even with ABD scatter enabled. IIRC on Linux it means only up to 1KB, while on FreeBSD up to 4KB by default. Also it is allowed for UNCACHED headers, which are not supposed to live long. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure the old code is generally incorrect, even though it is not uniform in its behavior. If we are writing a block in plain-text (not via raw receive) and then encrypt as part of ZIO pipeline, we effectively have two versions of data: one plain-text in buf
and one encrypted in zio->io_abd
. So at this point we seem to be free to choose whether to put into ARC plain-text or encrypted data (or we may put even both, but it would be a waste of memory). If we put plain-text, then any consumer that later wants encrypted, will have to read it from disk, but consumers that want plain-text will get it as-is without decryption (this I suppose is what breaks the test, since there is just no decryption to fail). If we put encrypted data, then following plain-text read will have to decrypt it, wasting time, while encrypted read will get the data as-is. So the question seems to be what is more efficient (plain-text reads are probably much more likely) or is there any more artifacts hidden.
@amotin |
While it is still a good question what shall we better do with this code, I think the test could instead be fixed by exporting/importing the pool instead of unmounting/mounting the dataset. |
Update: revert the change and fix test instead. |
I've never seen it before, but now for some reason it failed on (and only on)
|
Hmm... It seems more likely to fail when running multiple tests, but not single test. |
If we turn off zfs_abd_scatter_enabled, we can allow buffer sharing during arc_write_ready. However, this will cause decrypt_fault.ksh to fail. It seems we need to export the pool to guarantee we will attempt to decrypt the file again so fault injection will work. Signed-off-by: Chunwei Chen <[email protected]>
Motivation and Context
Description
If we turn off zfs_abd_scatter_enabled, we can allow buffer sharing
during arc_write_ready. However, this will cause decrypt_fault.ksh to
fail. It seems we need to export the pool to guarantee we will attempt
to decrypt the file again so fault injection will work.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.