[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [sparc64] sigbus in e2fsck

On Tue, Aug 30, 2016 at 01:25:10PM -0700, Darrick J. Wong wrote:
> AFAICT, each bh is malloc'd via e2fsck_allocate_memory and nothing seems
> to guarantee that the char b_data[1024] will be aligned to a multiple of
> 8 (it certainly isn't on x64), so I guess this isn't much of a surprise.
> We could change b_data to a pointer and then posix_memalign it.

Actually, all we need to do is to rearrange the structure elements so
it looks like this:

	unsigned long long b_blocknr;
	char            b_data[1024];

Since b_blocknr will need to be eight byte aligned, this will also
ensure that b_data will also be aligned correctly.

       	    	   	     		- Ted

Reply to: