1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

1923 Commits

Author SHA1 Message Date
Alasdair Kergon
a8d13f9499 Handle decimal digits with --units instead of ignoring them silently.
Fix remaining warnings and compile with -Wpointer-arith.
2011-02-18 23:09:55 +00:00
Zdenek Kabelac
faf2288895 Fix gcc warnings for unused variables
Put dead assigment code into comment.
2011-02-18 16:17:56 +00:00
Zdenek Kabelac
0a62e0145a Add some backtraces for error paths in process_each_lv 2011-02-18 15:02:25 +00:00
Zdenek Kabelac
aec2115410 Const fixing
Fixing some const warnings - with API change in:

int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names,

Change is needed - as lvm2api expects const behaviour here.
So vg_extend() is doing local strdup for unescaping.

skip_dev_dir return const char* from const char* vg_name.

Rest of the patch is cleanup of related warnings.

Also using dm_report_filed_string() API change to simplify
casting in _string_disp and _lvname_disp.
2011-02-18 14:47:28 +00:00
Zdenek Kabelac
4ebc6404ee Void* arithmetic replaced with char* 2011-02-18 14:34:41 +00:00
Zdenek Kabelac
ab8b85fb80 Fix !DEVMAPPER_SUPPORT build
Fix build when devmapper is disabled.
2011-02-18 14:29:39 +00:00
Zdenek Kabelac
44376ffe22 Remove fs_unlock after failed suspend
Explicit fs_unlock() after failed suspend is not need -
as it will happen automatically with nearest lv_info()
or vg_unlock().
2011-02-18 14:26:31 +00:00
Zdenek Kabelac
b1bcff7424 Critical section
New strategy for memory locking to decrease the number of call to
to un/lock memory when processing critical lvm functions.

Introducing functions for critical section.

Inside the critical section - memory is always locked.
When leaving the critical section, the memory stays locked
until memlock_unlock() is called - this happens with
sync_local_dev_names() and sync_dev_names() function call.

memlock_reset() is needed to reset locking numbers after fork
(polldaemon).

The patch itself is mostly rename:

memlock_inc  -> critical_section_inc
memlock_dec  -> critical_section_dec
memlock      -> critical_section

Daemons (clmvd, dmevent) are using memlock_daemon_inc&dec
(mlockall()) thus they will never release or relock memory they've
already locked memory.

Macros sync_local_dev_names() and sync_dev_names() are functions.
It's better for debugging - and also we do not need to add memlock.h
to locking.h header (for memlock_unlock() prototyp).
2011-02-18 14:16:11 +00:00
Zdenek Kabelac
794e94fe16 Replace PV_MIN_SIZE with function pv_min_size()
Add configurable option to define minimal size of
of block device usable as a PV.

pv_min_size() is added to lvm-globals and it's being
initialized through _process_config.

Macro PV_MIN_SIZE is unused and removed.

New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global
and unlike PV_MIN_SIZE it uses KB units.

Should help users with various slow devices attached to the system,
which cannot be easily filtered out (like FDD on /dev/sdX):
https://bugzilla.redhat.com/show_bug.cgi?id=644578
2011-02-18 14:11:22 +00:00
Zdenek Kabelac
9dd091e4f4 Support 64bit ints in config 2011-02-18 14:08:22 +00:00
Jonathan Earl Brassow
c054e7cc56 Fix for bug 677739: removing final exclusive cmirror snapshot,
results in clvmd deadlock

When a logical volume is activated exclusively in a cluster, the
local (non-cluster-aware) target is used.  However, when creating
a snapshot on the exclusive LV, the resulting suspend/resume fails
to load the appropriate device-mapper table - instead loading the
cluster-aware target.

This patch adds an 'exclusive' parameter to the pertinent resume
functions to allow for the right target type to be loaded.
2011-02-18 00:36:04 +00:00
Alasdair Kergon
7ad6a7d911 post-release 2011-02-09 12:11:21 +00:00
Alasdair Kergon
db76c0d09e pre-release 2011-02-09 12:04:39 +00:00
Jonathan Earl Brassow
8f400f5a25 orginal WHATS_NEW entry was changed to be less in-line with change it
was associated with.  Update entry to be clearer than both.
2011-02-08 22:35:11 +00:00
Zdenek Kabelac
2fdd451b19 Fix CRC32 calculation on big endian CPU
Fix regresion from 2.02.75 speedup - so currently crc32 is a little bit
more complicated on big-endian CPU as the uint32_t needs to be shifted
on here.
2011-02-08 12:41:08 +00:00
Alasdair Kergon
0ea1e5c109 post-release 2011-02-04 22:46:18 +00:00
Alasdair Kergon
6c7b95f281 pre-release 2011-02-04 22:07:43 +00:00
Jonathan Earl Brassow
27ff8813da Allow snapshots in a cluster as long as they are exclusively
activated.

In order to achieve this, we need to be able to query whether
the origin is active exclusively (a condition of being able to
add an exclusive snapshot).

Once we are able to query the exclusive activation of an LV, we
can safely create/activate the snapshot.

A change to 'hold_lock' was also made so that a request to aquire
a WRITE lock did not replace an EX lock, which is already a form
of write lock.
2011-02-04 20:30:17 +00:00
Zdenek Kabelac
880507498a Add --addnodeonresume, --addnodeoncreate
Add new function dm_task_set_add_node() to select between 2 types
of node creation in device directory.

DM_ADD_NODE_ON_RESUME is now default and ensures node is created on
resume. Old original behavior is accessible with DM_ADD_NODE_ON_CREATE.
In this case node would be created during dmsetup create --notable.

For the user 2 new options for dmsetup create are added:
[{--addnodeonresume | --addnodeoncreate }]

Properly working node creation on resume is needed for proper operation
stacking and ability to correctly check in which state the device should
after whole udev transation.
2011-02-04 19:33:53 +00:00
Zdenek Kabelac
fa6a525c2d Use cluster-wide message to request device name sync
Thanks to CLVMD_CMD_SYNC_NAMES propagation fix the message passing started
to work. So starts to send a message before the VG is unlocked.
Removing also implicit sync in VG unlock from clmvd as now the message
is delievered and processed in do_command().
Also add support for this new message into external locking
and mask this event from further processing.
2011-02-04 19:18:16 +00:00
Zdenek Kabelac
f5f6dcbc62 Fix operation node stacking for consecutive dm ops
With the ability to stack many operations in one udev transaction -
in same cases we are adding and removing same device at the same time
(i.e. deactivate followed by activate).

This leads to a problem of checking stacked operations:
i.e. remove /dev/node1 followed by create /dev/node1

If the node creation is handled with udev - there is a problem as
stacked operation gives warning about existing node1 and will try to
remove it - while next operation needs to recreate it.

Current code removes all previous stacked operation if the fs op is
FS_DEL - patch adds similar behavior for FS_ADD - it will try to
remove any 'delete' operation if udev is in use.

For FS_RENAME operation it seems to be more complex. But as we
are always stacking FS_READ_AHEAD after FS_ADD operation -
should be safe to remove all previous operation on the node
when udev is running.

Code does same checking for stacking libdm and liblvm operations.

As a very simple optimization counters were added for each stacked ops
type to avoid unneeded list scans if some operation does not exists in
the list.

Enable skipping of fs_unlock() (udev sync) if only DEL operations are staked.
as we do not use lv_info for already deleted nodes.
2011-02-04 19:14:39 +00:00
Zdenek Kabelac
135af49da5 Increase hash table size to 1024 lv names and 64 pv uuids 2011-02-03 16:03:13 +00:00
Zdenek Kabelac
3a00204a23 Remove fs_unlock from lv_resume path
Keep it within clvmd until message for SYNC starts to work.
2011-02-03 01:58:20 +00:00
Zdenek Kabelac
16f000bcb4 Fix wipe size when seting up mda. 2011-02-03 01:41:03 +00:00
Zdenek Kabelac
401a40d941 Do not check for open_count when not needed.
Disable open_count checking in lv_info it it's not used.

Fix previous commit (comment out unsable code for now).
2011-02-03 01:24:46 +00:00
Alasdair Kergon
12e36e7ea7 Allow CLVMD_CMD_SYNC_NAMES to be propagated around the cluster if requested. 2011-02-02 23:39:39 +00:00
Dave Wysochanski
42715fa173 Update WHATS_NEW for lvmdump change. 2011-02-01 21:41:31 +00:00
Zdenek Kabelac
116cbc267c Fix udev synchronization for no-locking mode
Instead of implicitly syncing udev operation in clustered and
file locking code -  call synchronization directly in lock_vol() when
the operation unlocks VG

The problem is missing implicit fs_unlock() in the no_locking code.
This is used with --sysinit on read-only filesystem locking dir.
In this case vgchange -ay could exit before all udev nodes are properly
synchronised and may cause problems with accessing such node right after
vgchange --sysinint command is finished.

Add test case for vgchange --sysinit.
2011-01-31 19:52:40 +00:00
Zdenek Kabelac
667d14e377 Updating man pages 2011-01-28 16:03:38 +00:00
Zdenek Kabelac
65fc4dae3a Avoid rebuilding of uuid validation table
Small CPU relax...
2011-01-28 10:14:08 +00:00
Mike Snitzer
3e3591904b Improve lvcreate "insufficient extents" errors to "insufficient free space". 2011-01-28 02:58:00 +00:00
Alasdair Kergon
a1d4ec1d6e Use O_DIRECT when reading block devices. 2011-01-27 00:21:37 +00:00
Alasdair Kergon
67199cac4f post-release 2011-01-24 23:34:46 +00:00
Alasdair Kergon
c446a0fffd pre-release 2011-01-24 23:24:06 +00:00
Alasdair Kergon
16b1fe4a08 Bring lvscan man page up-to-date. 2011-01-24 20:02:07 +00:00
Alasdair Kergon
cef065f63f Fix lvchange --test to exit cleanly. 2011-01-24 14:19:05 +00:00
Alasdair Kergon
b51cd542be Add change_tag to toollib.
Allow multiple pvchange command line options to be specified together.
2011-01-24 13:38:31 +00:00
Milan Broz
74863007ee 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.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=602389
2011-01-19 23:11:39 +00:00
Milan Broz
679830cf58 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.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=612862
2011-01-19 23:09:31 +00:00
Milan Broz
92e6277c28 Add -f (don't fork) option to clvmd and fix clvmd -d<num> description. 2011-01-17 23:13:14 +00:00
Alasdair Kergon
59762452a0 post-release 2011-01-17 18:16:18 +00:00
Alasdair Kergon
01794a7891 pre-release 2011-01-17 16:46:50 +00:00
Zdenek Kabelac
6184b70cf7 Do not scan devices unnecessarily for reseting error counter
For reseting error counter use directly btree cached elements and do not
create whole dev_iterator.
2011-01-17 15:16:55 +00:00
Zdenek Kabelac
96eda8b9b3 Skip unnecessary lock_vol() call after volume deactivation
Improve condition within lock_vol so we are not calling extra unlock
if the volume just has been deactivated.

Patch uses lck_type and replaces negative 'and' condition to more
readable 'or' condition.
Few missing strace traces added.
2011-01-13 14:56:17 +00:00
Zdenek Kabelac
b1b38215ba 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.
2011-01-13 14:51:32 +00:00
Alasdair Kergon
a8de276520 Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)
Introduce sync_local_dev_names and CLVMD_CMD_SYNC_NAMES to issue fs_unlock.
2011-01-12 20:42:50 +00:00
Alasdair Kergon
b84bb4d9c2 add fio 2011-01-12 15:28:33 +00:00
Jonathan Earl Brassow
025e69a15a Add disk to mirrored log type conversion. 2011-01-11 17:05:08 +00:00
Alasdair Kergon
2a66b79d55 post-release 2011-01-10 21:12:54 +00:00
Alasdair Kergon
22ba1e8ee6 reissue 2.02.80 2011-01-10 21:12:18 +00:00