]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: avoid unaligned access to dqc_bitmap
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 15 Nov 2011 22:56:34 +0000 (14:56 -0800)
committerXiaowei.Hu <xiaowei.hu@oracle.com>
Wed, 29 Aug 2012 06:09:26 +0000 (14:09 +0800)
commit532f78f69561c395c3a3b483499105433c0cdd0d
tree6684fef71063a330793e9a38f0a8e3f9f7b80b38
parent3269b9b9bb57fc32212976ce4737219f7b721afe
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 <akpm@linux-foundation.org>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
(cherry picked from commit 939255798a468e1a92f03546de6e87be7b491e57)

Signed-off-by: Xiaowei.Hu <xiaowei.hu@oracle.com>
fs/ocfs2/ocfs2.h
fs/ocfs2/quota_local.c