Skip to content

Conversation

@devnexen
Copy link
Member

With filesystems with builtin large capacity such as ZFS, Btfrs, NTFS
or even ext4 with large_dir feature enabled, an int to represent an
entry index is falling short, thus risking overflows.

A zend_long however should cover this need without increasing out internal data structure.

With filesystems with builtin large capacity such as ZFS, Btfrs, NTFS or even ext4 with large_dir feature enabled, an int to represent an entry index is falling short, thus risking overflows. A zend_long however should cover this need without increasing out internal data structure.
@devnexen
Copy link
Member Author

devnexen commented Dec 14, 2025

PR after discussing it with @Girgias. As she said, the change even fills the existing padding in the inner directory struct on 64 bits.

@ndossche
Copy link
Member

Makes sense. Could even be unsigned?

@devnexen
Copy link
Member Author

devnexen commented Dec 14, 2025

in practice, there is no actual FS able to handle a number of directory entries remotely close to INT64_MAX, we might be safe for a while I think ; not forever.

Copy link
Member

@ndossche ndossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked all uses of u.dir.index and seems fine. Thanks.

@devnexen devnexen closed this in ae59c69 Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants