linux/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 [ATM]: [horizon] fix sparse warnings 2005-11-10 12:55:52 -08:00
base [PATCH] fix leaks in request_firmware_nowait 2005-11-13 18:14:17 -08:00
block [PATCH 3/3] cciss: add put_disk into cleanup routines 2005-11-18 22:05:36 +01:00
bluetooth [Bluetooth]: Add endian annotations to the core 2005-11-08 09:57:21 -08:00
cdrom [PATCH] drivers/cdrom: kmalloc + memset -> kzalloc conversion 2005-11-07 07:53:59 -08:00
char [PATCH] unpaged: ZERO_PAGE in VM_UNPAGED 2005-11-22 09:13:42 -08:00
connector [PATCH] Process Events Connector 2005-11-07 07:53:35 -08:00
cpufreq [PATCH] cpufreq: silence cpufreq for UP 2005-11-22 09:13:44 -08:00
crypto
dio [PATCH] drivers/dio: kmalloc + memset -> kzalloc conversion 2005-11-07 07:53:59 -08:00
eisa [PATCH] drivers/eisa: kmalloc + memset -> kzalloc conversion 2005-11-07 07:53:59 -08:00
fc4 [PATCH] kfree cleanup: misc remaining drivers 2005-11-07 07:54:05 -08:00
firmware [PATCH] dell_rbu driver depends on x86[64] 2005-11-22 09:13:44 -08:00
hwmon Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00
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 macintosh: Always export pmu_[un]register_sleep_notifier if CONFIG_PM set 2005-11-08 12:14:50 +11:00
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 [PATCH] drivers/message/fusion/mptbase.c: make code static 2005-11-09 07:56:41 -08:00
mfd [DRIVER MODEL] Convert platform drivers to use struct platform_driver 2005-11-09 22:32:44 +00:00
misc Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00
mmc [MMC] mmci doesn't need asm/irq.h 2005-11-12 17:26:21 +00:00
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 [PATCH] kfree cleanup: misc remaining drivers 2005-11-07 07:54:05 -08:00
pci [PATCH] shpchp_hpc build fix 2005-11-13 18:14:12 -08:00
pcmcia [PCMCIA] inform user of insertion and ejection events 2005-11-12 23:35:34 +01:00
pnp [PATCH] drivers/pnp/: cleanups 2005-11-07 07:54:09 -08:00
rapidio [PATCH] rapidio: message interface updates 2005-11-07 07:53:47 -08:00
s390 [PATCH] s390: fix class_device_create calls in 3270 the driver 2005-11-18 07:49:46 -08:00
sbus [SPARC]: Fix RTC compat ioctl kernel log spam. 2005-11-12 12:10:54 -08:00
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 [PATCH] superhyway: multiple block support and VCR rework 2005-11-07 07:53:28 -08:00
sn
tc [MIPS] zs.c: Resurrect the deceased zs.c for now. 2005-11-17 16:23:39 +00:00
telephony [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason 2005-11-09 07:55:57 -08:00
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 [PATCH] kfree cleanup: misc remaining drivers 2005-11-07 07:54:05 -08:00
zorro
Kconfig
Makefile [PATCH] RapidIO support: core base 2005-11-07 07:53:46 -08:00