1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/daemons/cmirrord
Jonathan Earl Brassow 498747d792 A misunderstanding of the return value of 'dm_bit' has been causing a data
corruption bug in cmirror.  'dm_bit' is only ever used as a boolean operation
within LVM, but it can return a range of values.  If the bit is set, a power of
2 is returned.  If the bit is unset, 0 is returned.

'log_test_bit' (a function in the cluster mirror log daemon code) has switched
to using the dm bit operations in rhel6.  There are two places in the daemon
code where 'log_test_bit' is not used merely as a boolean, but rather the
return value is used as the return value for the log functions 'is_clean' and
'in_sync' - having assumed that 'dm_bit' was returning 0 or 1 only.

One place the 'in_sync' function is utilized is in 'dm_rh_get_state' - a
function that informs the mirroring code how to treat I/O and which devices to
read/write from.  'dm_rh_get_state' was checking if the return value of
'in_sync' was 1 to determine if the region was DM_RH_CLEAN.  Since 'dm_bit'
(and by extension 'log_test_bit' and 'in_sync') was returning powers of 2,
DM_RH_CLEAN was rarely being reported as it should have been.  Thinking the
region was out-of-sync, the mirroring code would write only to the primary
device.  When the primary device was failed, all of those writes were lost -
leaving the entire mirror corrupted.
2010-08-04 18:18:18 +00:00
..
clogd.c Add dm_create_lockfile to libdm to handle pidfiles for all daemons. 2010-07-13 13:51:01 +00:00
cluster.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
cluster.h Deal with a few more compiler warnings. 2010-01-20 02:43:19 +00:00
common.h Clean up include files. 2010-01-18 21:07:24 +00:00
compat.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
compat.h Clean up include files. 2010-01-18 21:07:24 +00:00
functions.c A misunderstanding of the return value of 'dm_bit' has been causing a data 2010-08-04 18:18:18 +00:00
functions.h Clean up include files. 2010-01-18 21:07:24 +00:00
link_mon.c Signal handling FIXMEs. 2010-01-19 15:58:45 +00:00
link_mon.h Clean up include files. 2010-01-18 21:07:24 +00:00
local.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
local.h Clean up include files. 2010-01-18 21:07:24 +00:00
logging.c Clean up include files. 2010-01-18 21:07:24 +00:00
logging.h Use "" instead of <> for configure.h and libdevmapper.h 2010-06-15 11:00:44 +00:00
Makefile.in INSTALL rules updates 2010-04-09 21:42:48 +00:00