Milan Broz [Wed, 19 Jan 2011 23:11:39 +0000 (23:11 +0000)]
If other process finishes (or aborts) pvmove operation and
polling function cannot find any lv with PVMOVE flag, return
success and do not print "aborting" message.
Milan Broz [Wed, 19 Jan 2011 23:09:31 +0000 (23:09 +0000)]
In some versions (RHEL6) dlm_create_lockspace() always
return lockspace reference (even if lockspace already exists)
and thus increases DLM lockspace count. It means that after
clvmd restart the lockspace is still in use.
(The only way to clean environment to enable clean cluster
shutdown is call "dlm_tool leave clvmd" several times.)
Because only one clvmd can run in time, we can use simpler logic,
try to open lockspace with dlm_open_lockspace() and only if it fails
try to create new one. This way the lockspace reference doesn not
increase.
Very easily reproducible with "clvmd -S" command.
Patch also fixes return code when clvmd_restart fails and fixes
double free if debug option was specified during restart.
Add test to make sure that a log device is retained when a
mirror image fails and the policies are set to:
mirror_image_fault_policy = "replace"
mirror_log_fault_policy = "remove"
Zdenek Kabelac [Thu, 13 Jan 2011 14:51:32 +0000 (14:51 +0000)]
Add exec_cmd paramater sync_needed
As sync_local_dev_names() cannot be called within activation context,
add new parametr which allows to select if the sync call is needed
before executing new command.
Zdenek Kabelac [Thu, 13 Jan 2011 11:05:27 +0000 (11:05 +0000)]
Check for file with clvmd pid
Instead of checking $LOCAL_CLVMD set during some 'aux' execution which
doesn't seem to be propagated to this shell - check for existance of pid
file of clvmd process - so this test is skipped in singlenode cluster test.
Zdenek Kabelac [Thu, 13 Jan 2011 11:02:55 +0000 (11:02 +0000)]
Hotfix to stop harness busylooping
Harness seems to be able to busyloop in while cycle and not moving forward
for certain buffer - so check whethere there was some progress.
This fix allows to continue after failed cluster test.
Fix gcc warning for hiding global variable 's' -> sig.
Zdenek Kabelac [Mon, 10 Jan 2011 14:02:30 +0000 (14:02 +0000)]
Speedup consequent activation calls
Stop calling fs_unlock() from lv_de/activate().
Start using internal lvm fs cookie for dm_tree.
Stop directly calling dm_udev_wait() and
dm_tree_set/get_cookie() from activate code -
it's now called through fs_unlock() function.
Add lvm_do_fs_unlock()
Call fs_unlock() when unlocking vg where implicit unlock solves the
problem also for cluster - thus no extra command for clustering
environment is required - only lvm_do_fs_unlock() function is added
to call lvm's fs_unlock() while holding lvm_lock mutex in clvmd.
Add fs_unlock() also to set_lv() so the command waits until devices
are ready for regular open (i.e. wiping its begining).
Move fs_unlock() prototype to activation.h to keep fs.h private
in lib/activate dir and not expose other functions from this header.
Zdenek Kabelac [Mon, 10 Jan 2011 13:13:42 +0000 (13:13 +0000)]
Change import_vg_from_buffer to use config_tree
Change function import_vg_from_buffer() to import_vg_from_config_tree().
Instead of creating config tree inside the function allow config tree to
be passed as parameter - usable later for caching.
Reverting recent commit to disallow adding/removing mirror log while
removing/adding mirror images... There was already code in there to
do the job - I just didn't find it in WHATS_NEW (or in the code right
away).
Prevent the user from simultaneously adding a mirror log while removing
a mirror image (or removing a log while adding a mirror). Advise the
user to use two separate commands instead.
This issue become especially problematic when PVs are specified, as they
tend to mean different things when adding vs removing. In a command that
mixes adding and removing, it is impossible to decern exactly what the
user wants.
Petr Rockai [Wed, 5 Jan 2011 00:16:18 +0000 (00:16 +0000)]
Substantial rework of the functional test support code. Some new features:
- somewhat neater, more consistent and more readable output
- possible to set any lvm.conf value: aux lvmconf "section/key = value"
- LVM_TEST_NODEBUG to suppress the (lengthy) "## DEBUG" output
- back-substitution on test output ($TESTDIR/$PREFIX -> @TESTDIR@/@PREFIX@)
- support code moved from test/ to test/lib/ --> less clutter
Zdenek Kabelac [Wed, 22 Dec 2010 15:44:09 +0000 (15:44 +0000)]
Remove check for existance of vg pointer
Checking for vg being != NULL in this place is not needed.
Pointer vg is already dereferced in this function above this code line.
Also this internal function _read_pv is always called with valid 'vg' pointer.
Zdenek Kabelac [Wed, 22 Dec 2010 14:00:28 +0000 (14:00 +0000)]
Fix last pthread_join fix commit
Call for pthread_join() does not set errno value even though return values
looks like that. For now assign errno from return value and still use
strerror() to print some error message as this seems to be commonly used.
Add also log_sys_error() message for error close of local pipe.