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

sparse test: fix for 64k page size #387

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

Fabian-Gruenbichler
Copy link
Contributor

this test failed on Debian's CI on ppc64el, because the page size is 64k there, which means the block size on tmpfs is as well, so attempting to create 32k big holes cannot work.

this test failed on Debian's CI on ppc64el, because the page size is
64k there, which means the block size on tmpfs is as well, so attempting
to create 32k big holes cannot work.

Signed-off-by: Fabian Grünbichler <[email protected]>
@Fabian-Gruenbichler
Copy link
Contributor Author

alternatively, the block size here could be #[cfg()]-ed based on the target arch

@Fabian-Gruenbichler
Copy link
Contributor Author

@alexcrichton alexcrichton merged commit 2064e86 into alexcrichton:main Nov 10, 2024
7 checks passed
@Fabian-Gruenbichler
Copy link
Contributor Author

Fabian-Gruenbichler commented Nov 11, 2024

I actually only realized afterwards there's another test case that has an assert that fails on powerpc64 for the same reason..

on the Debian side I just skip that assert for now, but the whole test would need a bigger refactor to handle different sparse granularities properly..

Index: tar/tests/all.rs
===================================================================
--- tar.orig/tests/all.rs
+++ tar/tests/all.rs
@@ -1301,7 +1301,8 @@ fn writing_sparse() {
     let data = t!(ar.into_inner());
 
     // Without sparse support, the size of the tarball exceed 1MiB.
-    #[cfg(target_os = "linux")]
+    // ppc64el has 64k pages and thus 64k blocks on tmpfs
+    #[cfg(all(target_os = "linux", not(target_arch = "powerpc64")))]
     assert!(data.len() <= 37 * 1024); // ext4 (defaults to 4k block size)
     #[cfg(target_os = "freebsd")]
     assert!(data.len() <= 273 * 1024); // UFS (defaults to 32k block size, last block isn't a hole)

would a patch adapting that properly also be welcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants