Skip to content
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

DRR_BEGIN payload should use NV_ENCODE_XDR #6898

Closed
tcaputi opened this issue Nov 25, 2017 · 1 comment
Closed

DRR_BEGIN payload should use NV_ENCODE_XDR #6898

tcaputi opened this issue Nov 25, 2017 · 1 comment
Labels
Status: Stale No recent activity for issue

Comments

@tcaputi
Copy link
Contributor

tcaputi commented Nov 25, 2017

Describe the problem you're observing

While working on verifying the on-disk changes in #6864, I spent some time testing sends from big endian to little endian systems and discovered that (in several cases) they were broken. The source of the problem seems to be that dmu_send.c does not pack the DRR_BEGIN payload in XDR format. As a result, the receive side cannot interpret this payload and returns EOPNOTSUP. This is easy enough to fix with the following patch:

diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
index 76b9781..b16d9dd 100644
--- a/module/zfs/dmu_send.c
+++ b/module/zfs/dmu_send.c
@@ -1125,7 +1125,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
                        fnvlist_add_nvlist(nvl, "crypt_keydata", keynvl);
                }
 
-               payload = fnvlist_pack(nvl, &payload_len);
+               VERIFY0(nvlist_pack(nvl, (char **)&payload, &payload_len,
+                   NV_ENCODE_XDR, KM_SLEEP));
                drr->drr_payloadlen = payload_len;
                fnvlist_free(keynvl);
                fnvlist_free(nvl);

The only issue is that this technically constitutes an ABI / format change. The good news, however, is that even older code should be able to understand this change since the nvlist_unpack() function reads the encoding.

Describe how to reproduce the problem

Attempt a resumed or raw send from a big endian system to a little endian one (or visa versa)

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@stale stale bot closed this as completed Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale No recent activity for issue
Projects
None yet
Development

No branches or pull requests

1 participant