koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
116 stars 88 forks source link

Fix some undefined behaviors #304

Closed tavianator closed 1 month ago

tavianator commented 2 months ago

A user reported that bcachefs-tools built with LTO segfaults in the bcachefs format subcommand. On a hunch, I built bcachefs-tools with UBSan and fixed some undefined behavior reports. They are not all fixed, but this is enough to successfully format a disk image.

Link: https://lore.kernel.org/linux-bcachefs/ZnWeguEIABfeP2xV@roethke.info/T/#u

koverstreet commented 1 month ago

The libbcachefs/ commits need to be done in the kernel repository, then imported - can you redo those against the bcachefs repo and send me a pull?

tavianator commented 1 month ago

Done! This PR now contains only the raid/cpu.h fix. The kernel side is https://github.com/koverstreet/bcachefs/pull/709.

koverstreet commented 1 month ago

Merged the raid fix, rest will be coming in via an import from kernel tree shortly