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

1238 Commits

Author SHA1 Message Date
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