Index: LVM2.2.02.39/lib/mirror/mirrored.c =================================================================== --- LVM2.2.02.39.orig/lib/mirror/mirrored.c 2008-04-11 02:53:36.000000000 +0800 +++ LVM2.2.02.39/lib/mirror/mirrored.c 2010-03-17 16:42:29.000000000 +0800 @@ -376,7 +376,7 @@ * FIXME: Fails incorrectly if cmirror was built into kernel. */ if (attributes) { - if (!_mirror_attributes && module_present("cmirror")) + if (!_mirror_attributes && module_present("log-userspace")) _mirror_attributes |= MIRROR_LOG_CLUSTERED; *attributes = _mirror_attributes; } Index: LVM2.2.02.39/lib/activate/activate.c =================================================================== --- LVM2.2.02.39.orig/lib/activate/activate.c 2010-03-17 16:42:29.000000000 +0800 +++ LVM2.2.02.39/lib/activate/activate.c 2010-03-17 17:21:20.000000000 +0800 @@ -408,6 +408,26 @@ return ret; } +/* 0 on not running, 1 on running */ +static int check_cmirrord() +{ + int fd; + int ret = 0; + struct flock lock; + if (( fd = open("/var/run/cmirrord.pid", O_WRONLY)) >= 0) + { + lock.l_type = F_WRLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + if (fcntl(fd, F_SETLK, &lock) < 0) { + ret = 1; + } + close(fd); + } + return ret; +} + int target_present(const char *target_name, int use_modprobe) { uint32_t maj, min, patchlevel; @@ -415,6 +435,16 @@ if (!activation()) return 0; + if (!strncmp(target_name, "log-userspace", 13)) { + /* + When the target_name is log-userspace, it also means + we need cmirrord daemon running. It doesn't work alone. + */ + if (!check_cmirrord()) + log_error("cmirrord is required, but not running now."); + return_0; + } + #ifdef MODPROBE_CMD if (use_modprobe) { if (target_version(target_name, &maj, &min, &patchlevel))