]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: avoid unaligned access to dqc_bitmap
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 28 Sep 2011 00:49:47 +0000 (10:49 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 29 Sep 2011 06:07:54 +0000 (16:07 +1000)
commit681bac1a6c7e3485e055168865045255edec9cee
tree47bb8c023164415f2225277e9d8673f9d8646afd
parent31a9ad684c2a23b6514ea5198c4b03ba69499424
ocfs2: avoid unaligned access to dqc_bitmap

The dqc_bitmap field of struct ocfs2_local_disk_chunk is 32-bit aligned,
but not 64-bit aligned.  The dqc_bitmap is accessed by ocfs2_set_bit(),
ocfs2_clear_bit(), ocfs2_test_bit(), or ocfs2_find_next_zero_bit().  These
are wrapper macros for ext2_*_bit() which need to take an unsigned long
aligned address (though some architectures are able to handle unaligned
address correctly)

So some 64bit architectures may not be able to access the dqc_bitmap
correctly.

This avoids such unaligned access by using another wrapper functions for
ext2_*_bit().  The code is taken from fs/ext4/mballoc.c which also need to
handle unaligned bitmap access.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <>
fs/ocfs2/ocfs2.h
fs/ocfs2/quota_local.c