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

1296 Commits

Author SHA1 Message Date
Alasdair Kergon
66fd45290c change clogd to cmirrord
make pidfile locn configurable
2009-08-28 20:51:40 +00:00
Alasdair Kergon
a946372e50 Rewrite clvmd configuration code. 2009-08-28 19:22:05 +00:00
Milan Broz
3c0cfa8f3c Fix global locking in PV reporting commands (2.02.49). 2009-08-24 11:37:20 +00:00
Milan Broz
c2d4398d47 Fix uuid warning in pvcreate to use terminated (and dash formatted) UUID string.
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7BoKYEeKMr033xK6o4og7F13sGi|��� already in use on "/dev/sdb1"
 is now
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi already in use on "/dev/sdb1"
2009-08-20 07:03:02 +00:00
Mike Snitzer
3d37e976bf Fix pvcreate on a partition (regressed in 2.02.51).
Eliminate busy loop during pvcreate of a "normal" partition.
_md_sysfs_attribute_snprintf() would busy loop if the device it was
given was not a blkext-based MD partition.

Rather than being cute with a busy-loop prone 'goto check_md_major' in
_md_sysfs_attribute_snprintf(): explicitly check if the provided device
is a blkext-based partition (blkext_major()); and then check that the
get_primary_dev() determined parent is an MD device (md_major()).
2009-08-19 15:34:33 +00:00
Dave Wysochanski
cdc8e54e3d Fix error paths for vgcfgrestore when locking fails. 2009-08-13 17:16:38 +00:00
Jonathan Earl Brassow
454bd4dc3b update WHATS_NEW 2009-08-13 16:36:49 +00:00
Petr Rockai
ea30184099 Make lvchange --refresh only take a read lock on volume group. 2009-08-13 14:27:32 +00:00
Petr Rockai
5d5e2bf8f6 Refactor file locking, lifting the flock wrapper code into separate
functions. Also fixes a bug, where a nonblocking lock could, in certain race
situations, succeed without actually obtaining the lock.
2009-08-13 13:23:51 +00:00
Dave Wysochanski
004c103c20 Update WHATS_NEW 2009-08-13 12:19:30 +00:00
Dave Wysochanski
2834bc8ee3 Update WHATS_NEW for recent checkins. 2009-08-13 12:04:01 +00:00
Christine Caulfield
defed336ae Fix compilation warning in clvmd.c 2009-08-13 10:39:41 +00:00
Alasdair Kergon
adfb0e348d post-release 2009-08-06 19:32:26 +00:00
Alasdair Kergon
7cec175dfc pre-release 2009-08-06 17:08:01 +00:00
Christine Caulfield
ee1e49ec53 Fix locking in clvmd
The changes to remove LCK_NONBLOCK from the LVM locks broke clvmd because the
code was clearly wrong but working anyway! The constant was being masked rather
than the variable that was supposed to match against it.
2009-08-05 14:18:35 +00:00
Peter Rajnoha
f3bc056a44 Add --noudevsync option for relevant LVM tools. 2009-08-04 15:55:43 +00:00
Alasdair Kergon
cf8235e0aa Add activation/udev_sync to lvm.conf. 2009-08-04 15:36:13 +00:00
Alasdair Kergon
aaa01e3488 Only create LV symlinks on ACTIVATE not PRELOAD.
(This is the udev behaviour - but does this change break anything?)
2009-08-03 18:09:25 +00:00
Petr Rockai
f5cb304acb Make lvconvert honour log mirror options combined with downconversion.
(RHBZ 463272)
2009-08-02 21:59:21 +00:00
Petr Rockai
0e867038da Allow LV suspend while --ignorelockingfailure is in force. 2009-08-02 21:03:09 +00:00
Petr Rockai
e516e0708c Update synopsis in lvconvert manpage to mention --repair. 2009-08-02 21:01:51 +00:00
Mike Snitzer
2aabcc1c1c Add devices/data_alignment_detection to lvm.conf.
Adds 'data_alignment_detection' config option to the devices section of
lvm.conf.  If your kernel provides topology information in sysfs (linux
>= 2.6.31) for the Physical Volume, the start of data area will be
aligned on a multiple of the ’minimum_io_size’ or ’optimal_io_size’
exposed in sysfs.

minimum_io_size is used if optimal_io_size is undefined (0).  If both
md_chunk_alignment and data_alignment_detection are enabled the result
of data_alignment_detection is used.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-08-01 17:08:43 +00:00
Mike Snitzer
57b660356e Add devices/data_alignment_offset_detection to lvm.conf.
If the pvcreate --dataalignmentoffset option is not specified the start
of a PV's aligned data area will be shifted by the associated
'alignment_offset' exposed in sysfs (unless
devices/data_alignment_offset_detection is disabled in lvm.conf).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-08-01 17:07:36 +00:00
Alasdair Kergon
bd90c6b2c2 Set cookies in activation code and wait for udev to complete processing. 2009-07-31 18:30:31 +00:00
Alasdair Kergon
2c0dfdf839 Add udevcomplete and --noudevwait to dmsetup. 2009-07-31 17:51:45 +00:00
Alasdair Kergon
4d8c4ea7e6 Add libdevmapper functions to support synchronisation with udev. 2009-07-31 15:53:11 +00:00
Alasdair Kergon
78ce7acc0c configure --udevdir 2009-07-31 13:31:53 +00:00
Alasdair Kergon
5d518f1f18 Prepare for udev synchronisation code. (options don't work yet) 2009-07-31 11:49:53 +00:00
Mike Snitzer
377b6a5843 Disable the "new pe_start policy"
Documented which use-cases force the reinstatement of the nuanced
handling of pe_start.  As soon as orphan PVs are eliminated much of this
will no longer be a concern ('preserve_pe_start' can be reenabled in
.pv_setup).

Added defensive 'if (pv->pe_align)' check in _text_pv_write()'s pe_start
loop.
2009-07-30 21:15:17 +00:00
Mike Snitzer
733bd656b2 Revert 'preserve_pe_start' related code in _text_pv_setup
If pv_setup was given a non-zero pe_start it would short-circuit
establishing a default pv->pe_align.  pv->pe_align=0 would result
in a divide by zero in _mda_setup().  'vgconvert -M2 $vgname' hit this.

.pv_write still properly preserves pe_start if it was supplied.
2009-07-30 18:40:22 +00:00
Mike Snitzer
04b2a4bdcf Add --dataalignmentoffset to pvcreate to shift start of aligned data area
Adds pe_align_offset to 'struct physical_volume'; is initialized with
set_pe_align_offset().  After pe_start is established pe_align_offset is
added to it.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:45:28 +00:00
Mike Snitzer
d01a37f597 Preserve pe_start in .pv_setup and .pv_write if pe_start was supplied.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:42:33 +00:00
Mike Snitzer
ad273af9c7 Fix _mda_setup() to not check first mda's size before pe_align rounding.
Without this fix rounding the end of the first mda to a pe_align
boundary could silently exceed the disk_size.

Final 'if (start1 + mda_size1 > disk_size)' block serves as a safety
net.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:19:31 +00:00
Mike Snitzer
2143b169b1 Formalize pe_start policy as split between .pv_setup and .pv_write.
Document existing pe_start policy.
Fix issue in _text_pv_setup() where existing pe_start case could have
the pv->pe_start set to pv->pe_align even though pe_start shouldn't ever
change.

vgconvert and pvcreate have a facility to preserve the existing start
of the on-disk data extents, known as pe_start.
They indicate this by passing the existing value to the pvsetup function
which must preserve it.

This patch avoids one particular case where the value could get
changed incorrectly now that the alignment settings are configurable.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2009-07-30 17:18:03 +00:00
Christine Caulfield
8b9e515185 Document the -I option to clvmd 2009-07-30 13:32:38 +00:00
Alasdair Kergon
82c445b01d Fix configure script to handle multiple clvmd selections. 2009-07-30 12:25:42 +00:00
Alasdair Kergon
9b6f239159 Fix lvm2app.pc installation filename. 2009-07-29 19:24:11 +00:00
Alasdair Kergon
9e813cc93b Remove pv_t, vg_t & lv_t handles from lib. Only liblvm uses them.
Rename lvm.h to lvm2app.h for now.
2009-07-29 13:26:01 +00:00
Alasdair Kergon
28ae3fe772 post-release 2009-07-28 20:47:40 +00:00
Alasdair Kergon
b0928986bf clean up a bit for release 2009-07-28 19:32:26 +00:00
Alasdair Kergon
29c70fbd86 pre-release 2009-07-28 17:07:48 +00:00
Dave Wysochanski
a44d004684 Update WHATS_NEW for latest liblvm changes 2009-07-27 21:10:30 +00:00
Dave Wysochanski
9c492aeecd Update WHATS_NEW for latest liblvm changes 2009-07-26 22:19:14 +00:00
Dave Wysochanski
a66c95ce44 Update WHATS_NEW for recent checkins 2009-07-26 11:21:32 +00:00
Alasdair Kergon
1cc59fa4ac Add global/wait_for_locks to lvm.conf so blocking on locks can be disabled. 2009-07-24 23:28:55 +00:00
Alasdair Kergon
c07d773e67 All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros. 2009-07-24 18:15:06 +00:00
Dave Wysochanski
e6923120b9 Revert previous patch that moved VG_ORPHAN lock inside vg_extend.
We must hold the VG_ORPHAN lock until we commit to disk.  Otherwise,
we risk a race condition on vgcreate / vgextend.  Reverts the following
commit:

commit 72a41480ba
Author: Dave Wysochanski <dwysocha@redhat.com>
Date:   Fri Jul 10 20:09:21 2009 +0000

    Move orphan lock obtain/release inside vg_extend().

    With this change we now have vgcreate/vgextend liblvm functions.
    Note that this changes the lock order of the following functions as the
    orphan lock is now obtained first.  With our policy of non-blocking
    second locks, this should not be a problem.

    Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-07-24 15:01:43 +00:00
Dave Wysochanski
1936861b9a Update WHATS_NEW for liblvm commits 2009-07-23 23:55:01 +00:00
Alasdair Kergon
7004662395 Add liblvm2app Makefile installation targets.
Add liblvm pkgconfig file.
2009-07-22 21:09:13 +00:00
Alasdair Kergon
340b6b0fb1 Use newly-independent LVM_LIBAPI in liblvm soname. E.g. liblvm2app.so.2.1. 2009-07-22 20:12:14 +00:00
Alasdair Kergon
bf45614685 Add an API version number, LVM_LIBAPI, to the VERSION string. 2009-07-22 20:01:28 +00:00
Mikulas Patocka
df4b9706da Pass struct cmd_context as a first argument to init_multiple_segtypes.
Remove redundant assignment seglib.cmd = cmd (done already at the beginning
of the function).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2009-07-21 20:00:02 +00:00
Alasdair Kergon
b68cc09932 Return EINVALID_CMD_LINE not success when invalid VG name format is used. 2009-07-21 11:10:49 +00:00
Dave Wysochanski
e0bd7c7645 Remove extraneous messages for extent_size and alloc_policy upon vgcreate.
When converting to the new liblvm functions, the vgcreate code path
changed to create a new vg, then set values.  As a result of this
change, and the fact that we give a user a message if they try to
set the same value of a VG attribute (extent_size, alloc_policy, etc),
you'll see these 2 extraneous "is already" messages with vgcreate:
tools/lvm vgcreate vg2 /dev/loop2
  Physical extent size of VG vg2 is already 4.00 MB
  Volume group allocation policy is already normal
  Volume group "vg2" successfully created

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-16 03:25:26 +00:00
Alasdair Kergon
9fac443591 Add log_errno to set a specific errno and replace log_error in due course. 2009-07-16 00:52:06 +00:00
Alasdair Kergon
d917192f00 Add lvm_errno and lvm_errmsg to liblvm to obtain failure information.
Change create_toolcontext to still return an object if it fails part-way.
Add EUNCLASSIFIED (-1) as the default LVM errno code.
2009-07-16 00:36:59 +00:00
Alasdair Kergon
d614646157 Store any errno and error messages issued while processing each command.
(Enabled by default while we test it, but in due course we'll only store
the error messages when we need to.)
2009-07-15 23:57:54 +00:00
Alasdair Kergon
b8f47d5f69 Use log_error macro consistently throughout in place of log_err. 2009-07-15 20:02:46 +00:00
Alasdair Kergon
26d7762bda post-release 2009-07-15 15:38:41 +00:00
Alasdair Kergon
7476b50218 pre-release 2009-07-15 15:16:48 +00:00
Alasdair Kergon
a7aa8b16d0 pre-release clarification 2009-07-15 14:59:14 +00:00
Alasdair Kergon
9386a68477 pre-release 2009-07-15 13:20:06 +00:00
Dave Wysochanski
213c999a92 Fix pvremove test breakage.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-14 19:59:41 +00:00
Milan Broz
8d9fb97582 Enable use of new multi-segment registration for static registration too.
so it allows this use:

#ifdef MYNEWSEG_INTERNAL
        if (!init_mynewseg_segtypes(&seglib))
                        return 0;
#endif
2009-07-14 12:17:14 +00:00
Alasdair Kergon
7beb03dd2a Exclude VG_GLOBAL from vg_write_lock_held so scans open devs read-only again. (mbroz) 2009-07-14 11:01:26 +00:00
Dave Wysochanski
867ff24616 Add liblvm test case for creating of a vg.
liblvm unit test case uses the following APIs:
- lvm_create, lvm_destroy
- lvm_vg_create, lvm_vg_extend, lvm_vg_set_extent_size, lvm_vg_write,
lvm_vg_remove, lvm_vg_close

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2009-07-14 03:08:56 +00:00
Dave Wysochanski
cec2a2dacc Remove READ_REQUIRE_RESIZEABLE flag from vg_read() interface - no users.
The checks for RESIZEABLE_VG should now be inside the various functions that
have to do such operations.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2009-07-14 02:19:19 +00:00
Mikulas Patocka
f012e6a1a0 WHATS_NEW 2009-07-13 23:16:17 +00:00
Alasdair Kergon
7f355587f5 Make cmd->cmd_line const. 2009-07-13 19:49:48 +00:00
Alasdair Kergon
c4c107f215 Fix dev name mismatch in vgcreate man page example. 2009-07-13 11:25:35 +00:00
Dave Wysochanski
a4f5a4cc2d Update WHATS_NEW for vgremove and ORPAHN_LOCK refactoring 2009-07-10 20:16:15 +00:00
Mike Snitzer
f1c90ec108 Check MD devices for a partition table during device scan. 2009-07-09 22:50:45 +00:00
Mike Snitzer
08f0d365fd Add extended device (blkext) and MD partition (mdp) types to filters.
Both types were added with a 'max_partitions' of 1 because these devices
are _not_ partitionable (they are the partitions).
2009-07-09 22:34:02 +00:00
Milan Broz
d09a7dfc6e Fix and precise metadata read errors for segment areas. 2009-07-09 11:29:41 +00:00
Milan Broz
25497e2fa5 Fix confusing metadata syntax error messages.
If there is syntax error in metadata, it now prints messages
like:
  Couldn't read 'start_extent' for segment 'extent_count'.
  Couldn't read all logical volumes for volume group vg_test.

The segment specification is wrong and confusing.

Patch fixes it by introducing "parent" member in config_node which
points to parent section and config_parent_name function, which
provides pointer to node section name.

Also it adds several LV references where possible.
2009-07-09 11:29:00 +00:00
Milan Broz
7fdf112457 Fix segment import functions to print segment name and logical volume name. 2009-07-09 11:28:09 +00:00
Dave Wysochanski
0d107e7014 Update WHATS_NEW for recent vgcreate changes 2009-07-09 10:19:07 +00:00
Dave Wysochanski
e0f4404a29 . 2009-07-08 22:22:12 +00:00
Dave Wysochanski
e5c935bd12 Update WHATS_NEW for vgread cleanup 2009-07-08 14:41:00 +00:00
Alasdair Kergon
dd1d42d5d0 Permit several segment types to be registered by a single shared object. 2009-07-08 12:36:01 +00:00
Mike Snitzer
1ad6d98bbe Reword the WHATS_NEW commandline sizes update. 2009-07-06 19:17:15 +00:00
Mike Snitzer
c1060e13a7 Allow commandline sizes to be specified in terms of bytes and sectors.
Update the man pages to document size units uniformly.
2009-07-06 19:13:26 +00:00
Mike Snitzer
bb6a3a9608 Use the MD device's stripe-width, instead of chunk_size, to align the
data blocks of a Physical Volume that is placed directly upon an MD
device.
2009-07-06 19:04:24 +00:00
Alasdair Kergon
b09a20e537 clarification 2009-07-03 11:04:06 +00:00
Dave Wysochanski
6e10090b58 Update WHATS_NEW for vg_read commits 2009-07-01 17:23:10 +00:00
Alasdair Kergon
4397ad387e post-release 2009-07-01 09:31:46 +00:00
Alasdair Kergon
e50c61d8fa update date 2009-06-30 18:41:47 +00:00
Alasdair Kergon
476d463348 pre-release tidy up 2009-06-30 18:39:31 +00:00
Alasdair Kergon
4f9012704c pre-release 2009-06-26 10:57:30 +00:00
Alasdair Kergon
f7c76e3878 revert last patch - let's do a release first 2009-06-26 10:55:57 +00:00
Dave Wysochanski
96d0004d12 Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).
Sun May  3 11:40:51 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).


Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-06-26 09:47:36 +00:00
Alasdair Kergon
2f5a1df42c Abort if automatic metadata correction fails when reading VG to update it. 2009-06-26 09:19:13 +00:00
Alasdair Kergon
024e2cd0e6 Abort operation if automatic metadata correction in lvconvert fails. 2009-06-26 09:03:59 +00:00
Milan Broz
6391d03f54 Fix backward compatibility for major:minor query.
Is an application uses query and set major:minor
to device, it should not fallback to default major by default.

Add new function whoich allows that (and use it in lvm2).
2009-06-17 20:55:24 +00:00
Milan Broz
a330337af2 Add WHATS_NEW items. 2009-06-15 15:09:02 +00:00
Milan Broz
1bf740434a Suggest use lvchange --resync when up converting not yet synced mirror. 2009-06-15 13:43:15 +00:00
Milan Broz
8bc510ba12 Destroy toolcontext on exit in clvmd (fixes memory pool leaks). 2009-06-15 12:15:23 +00:00
Milan Broz
9242380c2f Fix lvconvert to not poll mirror if no conversion in progress. 2009-06-15 12:08:59 +00:00
Milan Broz
38ddfe7be5 Fix memory leaks in toolcontext error path.
E.g.
 # vgscan
  Parse error at byte 2360 (line 54): expected a value
  Failed to load config file /etc/lvm/lvm.conf
You have a memory leak (not released memory pool):
 [0x818c788] library (12 bytes)

...
2009-06-15 11:56:31 +00:00
Milan Broz
2565a5e528 Fix WHATS_NEW - Allow metadata correction even when PVs are missing. 2009-06-12 08:34:15 +00:00