On Fri, Feb 23, 2024 at 09:42:21AM -0800, Linus Torvalds wrote: > And honestly, "__packed" really is wrong here. Nobody ever wanted it > to be completely unaligned. I'll let Ming speak, but I think the idea was to remove the padding at the end of the structure when embedded into the bio. > > I think we might be better off marking it as being 4-byte aligned. > That would mean that instead of __packed, it is done as > > __packed __aligned(4) > > > because "__aligned" on its own only increases alignment (so without > the __packed it would stay 8-byte aligned). > > Then the only part of that structure that might be unaligned is > "sector_t", and that would only matter on 64-bit architectures. Does __aligned also work on struct members? If so we could add a __aligned(8) to bi_sector an get exactly what we want..