diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-21 00:18:20 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-21 00:18:20 +0200 |
commit | 58ced38ac46976c1b0dfa91c513c8ccd170b4e26 (patch) | |
tree | 6a4d206050b8ddb2831f335de0e1bb96f8bae554 /mkfs/meta.c | |
parent | a2f477d76f8961f250b93f9aee91a5abf2e7c296 (diff) |
fix: inode number difference in dirent is actually signed
For now, it is enough to reduce the comparison value, since the inode
numbers are increasing.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/meta.c')
-rw-r--r-- | mkfs/meta.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mkfs/meta.c b/mkfs/meta.c index a0ea071..4ef570d 100644 --- a/mkfs/meta.c +++ b/mkfs/meta.c @@ -97,7 +97,9 @@ static int write_dir(meta_writer_t *dm, dir_info_t *dir, dir_index_t **index) for (d = c; d != NULL; d = d->next) { if ((d->inode_ref >> 16) != (c->inode_ref >> 16)) break; - if ((d->inode_num - c->inode_num) > 0xFFFF) + + /* XXX: difference is actually signed */ + if ((d->inode_num - c->inode_num) > 0x7FFF) break; size += sizeof(ent) + strlen(c->name); |