Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ jobs:
ls obd_mp
sudo diff -r --exclude "lost+found" test_data obd_mp
sudo umount obd_mp
mkdir -p htree_data/crowded
for i in $(seq 1 1000); do touch "htree_data/crowded/file-${i}"; done
tar -cf htree.tar -C htree_data .
truncate -s 1g htree.img
/opt/overlaybd/bin/overlaybd-apply --mkfs --raw htree.tar htree.img
sudo e2fsck -fn htree.img 2>&1 | tee htree-e2fsck.log || true
! grep -F "invalid limit (506)" htree-e2fsck.log
- name: E2E Test turboOCIv1
working-directory: ${{github.workspace}}/build
shell: bash
Expand Down Expand Up @@ -124,4 +131,4 @@ jobs:
uses: namespacelabs/breakpoint-action@v0
with:
duration: 30m
authorized-users: dines-rl
authorized-users: dines-rl
2 changes: 2 additions & 0 deletions CMake/Finde2fs.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
if(NOT ORIGIN_EXT2FS)
message("Add and build standalone libext2fs")
include(FetchContent)
set(_e2fsprogs_htree_patch "${CMAKE_CURRENT_LIST_DIR}/patches/e2fsprogs-fix-htree-root-limit.patch")
FetchContent_Declare(
e2fsprogs
GIT_REPOSITORY https://github.com/data-accelerator/e2fsprogs.git
GIT_TAG b4cf6c751196a12b1df9a269d8e0b516b99fe6a7
PATCH_COMMAND sh -c "git apply --reverse --check '${_e2fsprogs_htree_patch}' 2>/dev/null || git apply '${_e2fsprogs_htree_patch}'"
)
FetchContent_GetProperties(e2fsprogs)

Expand Down
16 changes: 16 additions & 0 deletions CMake/patches/e2fsprogs-fix-htree-root-limit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index 898a362c..d86d695e 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -185,7 +185,10 @@ static errcode_t make_indexed_dir(ext2_filsys fs, ext2_ino_t dir, struct ext2_i
entries = root->entries;
entries->block = ext2fs_cpu_to_le32(1);
((struct ext2_dx_countlimit *) entries)->count = ext2fs_cpu_to_le16(1);
- ((struct ext2_dx_countlimit *) entries)->limit = ext2fs_cpu_to_le16((blocksize - (32 + csum_size)) / sizeof(struct ext2_dx_entry));
+ ((struct ext2_dx_countlimit *) entries)->limit = ext2fs_cpu_to_le16(
+ (blocksize - 32 -
+ (csum_size ? sizeof(struct ext2_dx_tail) : 0)) /
+ sizeof(struct ext2_dx_entry));

/* write out blocks */
for (int i = 0; i < dx_info.levels; i++)
Loading