Be more precise about the maximum number of segments per list block
UINT16_MAX would be just over a disk block, and allocating another 3.93k for a single additional segment does not make sense. (gdb) p /x sizeof(struct fellow_disk_seg) * 65534 + sizeof(struct fellow_disk_seglist) $7 = 0x37ffd0 Also fix a potential overflow, where a uint16_t was incremented after clamping to UINT16_MAX.
Showing
Please register or sign in to comment