kernel-ark/drivers
Alasdair G Kergon 0e56822d30 [PATCH] device-mapper: mirror log bitset fix
The linux bitset operators (test_bit, set_bit etc) work on arrays of "unsigned
long".  dm-log uses such bitsets but treats them as arrays of uint32_t, only
allocating and zeroing a multiple of 4 bytes (as 'clean_bits' is a uint32_t).

The patch below fixes this problem.

The problem is specific to 64-bit big endian machines such as s390x or ppc-64
and can prevent pvmove terminating.

In the simplest case, if "region_count" were (say) 30, then
bitset_size (below) would be 4 and bitset_uint32_count would be 1.
Thus the memory for this butset, after allocation and zeroing would
be
   0 0 0 0 X X X X
On a bigendian 64bit machine, bit 0 for this bitset is in the 8th
byte! (and every bit that dm-log would use would be in the X area).

   0 0 0 0 X X X X
                 ^
                 here

which hasn't been cleared properly.

As the dm-raid1 code only syncs and counts regions which have a 0 in the
'sync_bits' bitset, and only finishes when it has counted high enough, a large
number of 1's among those 'X's will cause the sync to not complete.

It is worth noting that the code uses the same bitsets for in-memory and
on-disk logs.  As these bitsets are host-endian and host-sized, this means
that they cannot safely be moved between computers with

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-22 09:14:31 -08:00
..
acorn
acpi Fix ACPI processor power block initialization 2005-11-18 07:29:51 -08:00
atm
base
block [PATCH 3/3] cciss: add put_disk into cleanup routines 2005-11-18 22:05:36 +01:00
bluetooth
cdrom
char [PATCH] unpaged: ZERO_PAGE in VM_UNPAGED 2005-11-22 09:13:42 -08:00
connector
cpufreq [PATCH] cpufreq: silence cpufreq for UP 2005-11-22 09:13:44 -08:00
crypto
dio
eisa
fc4
firmware [PATCH] dell_rbu driver depends on x86[64] 2005-11-22 09:13:44 -08:00
hwmon
i2c [PATCH] Fix IXP4xx I2C driver build breakage 2005-11-17 11:23:48 -08:00
ide [PATCH] ide: add missing __init tags to device drivers 2005-11-19 22:24:35 +01:00
ieee1394 sbp2_command_orb_lock must be held when accessing the _orb_inuse list. 2005-11-18 16:41:39 -05:00
infiniband Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband 2005-11-18 14:33:03 -08:00
input Input: make serio and gameport more swsusp friendly 2005-11-20 00:56:43 -05:00
isdn [PARISC] Mark hisax and pcbit ISDN drivers as not for parisc 2005-11-18 16:20:10 -05:00
macintosh
mca
md [PATCH] device-mapper: mirror log bitset fix 2005-11-22 09:14:31 -08:00
media [PATCH] Fix an OOPS is CinergyT2 2005-11-20 14:06:28 -08:00
message
mfd
misc
mmc
mtd Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-19 15:24:42 -08:00
net [PATCH] net: Fix compiler-error on dgrs.c when !CONFIG_PCI 2005-11-22 09:13:41 -08:00
nubus
oprofile
parisc [PARISC] Make superio.c initialize before any driver needs it 2005-11-17 16:44:57 -05:00
parport
pci
pcmcia
pnp
rapidio
s390 [PATCH] s390: fix class_device_create calls in 3270 the driver 2005-11-18 07:49:46 -08:00
sbus
scsi [PATCH] Fix a bug in scsi_get_command 2005-11-22 09:13:44 -08:00
serial [SERIAL] imx: Fix missed platform_driver_unregister 2005-11-21 17:05:21 +00:00
sh
sn
tc [MIPS] zs.c: Resurrect the deceased zs.c for now. 2005-11-17 16:23:39 +00:00
telephony
usb [PATCH] Fix copy-paste bug in ohci-ppc-soc.c 2005-11-18 07:49:45 -08:00
video [PATCH] vgacon: Fix usage of stale height value on vc initialization 2005-11-22 09:13:43 -08:00
w1
zorro
Kconfig
Makefile