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

Re: Warning when mounting btrfs partition, kernel unaligned access



From: David Sterba <dave@jikos.cz>
Date: Wed, 13 Apr 2011 11:40:37 +0200

> On Wed, Apr 13, 2011 at 01:03:56AM +0200, Sébastien Bernard wrote:
>> Then, after writing on the disk, I got a lot of warning:
>> [  822.515875] Kernel unaligned access at TPC[103c2204]
>> 
>> I peeked a look at the btrf_csum_final and here's the function :
>> void btrfs_csum_final(u32 crc, char *result)
>> {
>>         *(__le32 *)result = ~cpu_to_le32(crc);
>> }
> 
> FYI, this has been fixed and is already merged into Linus' tree. Commit
> 7e75bf3ff3a716d7b21d8fb43bf823115801c1e9.

Might I suggest adding a BUG_ON() validation of the alignment or
similar here?

You can make the test really cheap, and this way no matter what kind
of systems the btrfs folks do their testing on this kind of regression
will be spotted fast.


Reply to: