Skip to content

Commit 13ff566

Browse files
author
Hongzhen Luo
committed
[EROFS] Add support for xattr reservation of the base layer rootdir
Set the minimum inline xattr size for the root directory of the base layer, as there may not be enough room for xattr during the incremental build process. Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
1 parent b5b704b commit 13ff566

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/overlaybd/tar/erofs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include(FetchContent)
33
FetchContent_Declare(
44
erofs-utils
55
GIT_REPOSITORY git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
6-
GIT_TAG 617d708925b3c5d1dd132853e47d9d9f51443e6f
6+
GIT_TAG ac0997ea32a465a6b0db7b782bb8d4d07952365a
77
)
88

99
FetchContent_MakeAvailable(erofs-utils)

src/overlaybd/tar/erofs/liberofs.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define round_down_blk(addr) ((addr) & (~(SECTOR_SIZE - 1)))
1818
#define round_up_blk(addr) (round_down_blk((addr) + SECTOR_SIZE - 1))
1919
#define min(a, b) (a) < (b) ? (a) : (b)
20+
#define EROFS_ROOT_XATTR_SZ (16 * 1024)
2021

2122
#define EROFS_UNIMPLEMENTED 1
2223

@@ -641,6 +642,10 @@ int LibErofs::extract_tar(photon::fs::IFile *source, bool meta_only, bool first_
641642
cfg.incremental = !first_layer;
642643
erofs_cfg = erofs_get_configure();
643644
erofs_cfg->c_ovlfs_strip = true;
645+
if (first_layer)
646+
erofs_cfg->c_root_xattr_isize = EROFS_ROOT_XATTR_SZ;
647+
else
648+
erofs_cfg->c_root_xattr_isize = 0;
644649
cfg.mp_fp = std::tmpfile();
645650

646651
err = erofs_mkfs(&cfg);

0 commit comments

Comments
 (0)