Eth King Powlison

Results 7 comments of Eth King Powlison

> I can add a new str_hash function that limits the result to 2**31 [...] If you do end up going the route of a new hash function, I'd suggest...

The comparison that 'glibc' is doing to check for truncation in `d_off`, is being done as a signed comparison with a `int64_t` and an `off_t` - meaning the 32-bit `off_t`...

Having peaked, prodded, replicated, and tested some patches against it, I think the code in glibc's `__getdents()`, `readdir()`, `telldir()`, and `seekdir()` is all absolutely correct for 32-bit code accessing a...

Understood! It's just a predicted new issue that might come from the same source of trouble. I don't know yet either whether or not it'll be the case, but it's...

Issue upgrade -- effects native x86 as well. Any hash above 31 bits on x86 will give `readdir(3)` an EOVERFLOW, `lseek(2)` EINVAL, and break `seekdir(3)`. -D_FILE_OFFSET_BITS=64 cannot fix `seekdir(3)`, since...

As for finding productive ways to fix this issue, [I've noticed that the `ext4` implementation breaks apart its hashes into a 'major:minor' of 32-bit hashes.](https://github.com/koverstreet/bcachefs/blob/c887148ebf9989ce8bdf6f814d4342ba5bf465fa/fs/ext4/dir.c#L324) Both are handed out at...

Apologies for channel spam, but it's confirmed! -- While ext4 uses 63-bit hashes internally, it detects 32-bit programs, and translates in and out just the top 31 bits of the...