diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | mkfs/meta.c | 10 |
2 files changed, 8 insertions, 4 deletions
@@ -47,8 +47,6 @@ At the moment, the following things still require some work: - rdsquashfs ignores them entirely - SquashFS supports deduplicating values through "out of line" storage but this is currently not used yet. - - empty directories cannot have xattrs. The way I understand it, this is a - design flaw in SquashFS. I hope I'm missing something here. - sparse files (not implemented yet; lots of zeros compress good anyway :P) - hard links (not implemented yet; do we even want this?) - File deduplication (not implemented; do we even need this?) diff --git a/mkfs/meta.c b/mkfs/meta.c index 4ef570d..8f344ef 100644 --- a/mkfs/meta.c +++ b/mkfs/meta.c @@ -187,7 +187,7 @@ static int write_inode(sqfs_info_t *info, meta_writer_t *im, meta_writer_t *dm, return -1; if ((di->start_block) > 0xFFFFFFFFUL || di->size > 0xFFFF || - (node->xattr != NULL && di->size != 0)) { + node->xattr != NULL) { type = SQFS_INODE_EXT_DIR; } else { type = SQFS_INODE_DIR; @@ -344,7 +344,7 @@ static int write_inode(sqfs_info_t *info, meta_writer_t *im, meta_writer_t *dm, .start_block = htole32(node->data.dir->start_block), .parent_inode = node->parent ? htole32(node->parent->inode_num) : htole32(1), - .inodex_count = htole32(diridx->num_nodes - 1), + .inodex_count = htole32(0), .offset = htole16(node->data.dir->block_offset), .xattr_idx = htole32(0xFFFFFFFF), }; @@ -357,6 +357,12 @@ static int write_inode(sqfs_info_t *info, meta_writer_t *im, meta_writer_t *dm, return -1; } + /* HACK: truncated index for empty directories */ + if (node->data.dir->size == 0) + break; + + ext.inodex_count = htole32(diridx->num_nodes - 1); + for (i = 0; i < diridx->num_nodes; ++i) { idx.start_block = htole32(diridx->idx_nodes[i].block); |