]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agolvconvert: switch to validate_lvname_param
Zdenek Kabelac [Sun, 28 Sep 2014 11:07:18 +0000 (13:07 +0200)]
lvconvert: switch to validate_lvname_param

Use new toollib function for validation.

10 years agotoollib: introduce validate_lvname_param
Zdenek Kabelac [Sun, 28 Sep 2014 10:57:39 +0000 (12:57 +0200)]
toollib: introduce validate_lvname_param

Function for parsing and validating of lvname parameter.

10 years agocleanup: rename func
Zdenek Kabelac [Sat, 27 Sep 2014 16:53:08 +0000 (18:53 +0200)]
cleanup: rename func

Update name of function read_and_validate_major_minor
and put it into the right header file toollib.h.

(In release update for f09f85d027d8833)

10 years agotoollib: refactor extract_vgname
Zdenek Kabelac [Sat, 27 Sep 2014 14:29:43 +0000 (16:29 +0200)]
toollib: refactor extract_vgname

Split internals of extract_vgname into _extract_vgname.
This common code will be used for other similar function.

Reuse skip_dev_dir() instead of less mature coded to skip
device dir.

Instead of duplicating full vg/lv name - allocate string
only vg portion of lv name.

10 years agotoollib: refactor skip_dev_dir
Zdenek Kabelac [Sun, 28 Sep 2014 10:54:20 +0000 (12:54 +0200)]
toollib: refactor skip_dev_dir

Detect dev dir just once.

10 years agoRevert "man: lvmcache should use clearer cache pool options"
Zdenek Kabelac [Sat, 27 Sep 2014 13:10:44 +0000 (15:10 +0200)]
Revert "man: lvmcache should use clearer cache pool options"

Revert: --cachepool  and --thipnpool is the right way

they both take arg

This is a major difference from  --cache   and --thin

10 years agoRevert "man: lvmthin should use clearer thin pool options"
Zdenek Kabelac [Sat, 27 Sep 2014 13:08:31 +0000 (15:08 +0200)]
Revert "man: lvmthin should use clearer thin pool options"

Revert: --cachepool  and --thipnpool is the right way

they both take arg

This is a major difference from  --cache   and --thin

10 years agoman: lvmthin should use clearer thin pool options
David Teigland [Fri, 26 Sep 2014 21:05:30 +0000 (16:05 -0500)]
man: lvmthin should use clearer thin pool options

Previously, this was the recommended form for creating a thin pool:

lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV

but this is confusing, because --thinpool does not actually take
an arg, and is more naturally used to specify an existing thin pool.

The new recommended form is:

lvconvert --type thin-pool --poolmetadata VG/ThinMetaLV VG/ThinDataLV

10 years agoman: lvmcache should use clearer cache pool options
David Teigland [Fri, 26 Sep 2014 19:40:40 +0000 (14:40 -0500)]
man: lvmcache should use clearer cache pool options

Previously, this was the recommended form for creating a cache pool:

lvconvert --cachepool VG/CacheDataLV --poolmetadata VG/CacheMetaLV

but this is confusing, because --cachepool does not actually take
an arg, and is more natually used to specify an existing cache pool.

The new recommended form is:

lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV

10 years agolvchange: missed bits for a8aee7dba2b76
Zdenek Kabelac [Wed, 24 Sep 2014 14:27:35 +0000 (16:27 +0200)]
lvchange: missed bits for a8aee7dba2b76

lv_info is not used here any more.
This code should have been committed with
lv_check_not_in_use API change commit.

10 years agocleanup: Use segtype.h definitions of segment type names wherever possible
Heinz Mauelshagen [Wed, 24 Sep 2014 13:24:41 +0000 (15:24 +0200)]
cleanup: Use segtype.h definitions of segment type names wherever possible

We are not using already defined segement type names where we could.

There is a lot of other places in device-mapper and LVM2 we have those
hardcoded so we should better finally have a common interface in
libdevmapper to avoid this.

10 years agotests: add helper funcionality for using gdb
Zdenek Kabelac [Sat, 20 Sep 2014 23:16:57 +0000 (01:16 +0200)]
tests: add helper funcionality for using gdb

When there is need for using gdb within test suite
just prefix command with LVM_DBG and run test in
standard shell (for stdin).

10 years agotests: drop * from dmsetup
Zdenek Kabelac [Sat, 20 Sep 2014 23:11:42 +0000 (01:11 +0200)]
tests: drop * from dmsetup

We cannot use shell expansion for dmsetup here.

10 years agodebug: add debug message
Zdenek Kabelac [Wed, 24 Sep 2014 08:03:55 +0000 (10:03 +0200)]
debug: add debug message

Since we leave error printing on the called of deactivation,
at least put in debug log for this case.

10 years agodebug: show stacktrace on error path
Zdenek Kabelac [Mon, 22 Sep 2014 13:59:50 +0000 (15:59 +0200)]
debug: show stacktrace on error path

10 years agodebug: drop printing debug trace without labeler
Zdenek Kabelac [Mon, 22 Sep 2014 11:34:12 +0000 (13:34 +0200)]
debug: drop printing debug trace without labeler

Not having labeller on device is not reason eo generate backtrace in log.

10 years agodebug: add missing stack trace
Zdenek Kabelac [Sun, 21 Sep 2014 09:48:09 +0000 (11:48 +0200)]
debug: add missing stack trace

10 years agodebug: monitor_dev_for_events stack trace
Zdenek Kabelac [Wed, 24 Sep 2014 07:58:04 +0000 (09:58 +0200)]
debug: monitor_dev_for_events stack trace

10 years agocleanup: reindent
Zdenek Kabelac [Tue, 23 Sep 2014 14:47:27 +0000 (16:47 +0200)]
cleanup: reindent

Save some code lines.

10 years agocleanup: drop duplicate const usage
Zdenek Kabelac [Mon, 22 Sep 2014 13:51:49 +0000 (15:51 +0200)]
cleanup: drop duplicate const usage

const char == const char const.

10 years agocleanup: drop uneeded backup call
Zdenek Kabelac [Mon, 22 Sep 2014 12:11:12 +0000 (14:11 +0200)]
cleanup: drop uneeded backup call

lv_update_and_reload already handle backup.

10 years agocleanup: use supplied cmd pointer
Zdenek Kabelac [Tue, 23 Sep 2014 14:49:46 +0000 (16:49 +0200)]
cleanup: use supplied cmd pointer

10 years agocleanup: fix typo and use vg mempool
Zdenek Kabelac [Sat, 20 Sep 2014 23:16:06 +0000 (01:16 +0200)]
cleanup: fix typo and use vg mempool

Since we are updating VG -  we can use its own mempool.

10 years agocleanup: replace error with print message
Zdenek Kabelac [Sat, 20 Sep 2014 20:05:29 +0000 (22:05 +0200)]
cleanup: replace error with print message

These are not error messages.
They are informing a user about missconfigured
options which do not change resulting error status.

10 years agocleanup: simplier _lv_passes_volumes_filter
Zdenek Kabelac [Sat, 20 Sep 2014 23:08:43 +0000 (01:08 +0200)]
cleanup: simplier _lv_passes_volumes_filter

Don't recreate string and just check components directly.

10 years agocleanup: use find_lv_in_vg_by_lvid
Zdenek Kabelac [Sun, 21 Sep 2014 09:46:34 +0000 (11:46 +0200)]
cleanup: use find_lv_in_vg_by_lvid

Replace another loop with existion function.

TODO: consider using hash maps for lvname & lvid lookups.

10 years agoactivate: update lv_check_not_in_use: API
Zdenek Kabelac [Wed, 24 Sep 2014 08:05:26 +0000 (10:05 +0200)]
activate: update lv_check_not_in_use: API

Use of lv_info() internally in lv_check_not_in_use(),
so it always could use with_open_count properly.

Skip sysfs() testing in open_count == 0 case.

Accept just 'lv' pointer like other functions.

The function has 'built-in' lv_is_active_locally check,
which however is not what we need to check in many place.
For now at least remotely active snapshot merge is
detected and for this case merge on next activation is scheduled.

10 years agolvconvert: reoder old snapshot merge
Zdenek Kabelac [Tue, 23 Sep 2014 18:23:09 +0000 (20:23 +0200)]
lvconvert: reoder old snapshot merge

Move check for snapshot-merge support before archiving.

Split code on 2 paths - with merge_on_activate
using vg_write & vg_commit
and lv_update_reload call for instant merging.

Move printing after backup.

10 years agocleanup: constify activation usage of lv pointer
Zdenek Kabelac [Mon, 22 Sep 2014 13:50:07 +0000 (15:50 +0200)]
cleanup: constify activation usage of lv pointer

Let's enforce cheking of write access to LV by compiler.
Activation part does never need to write anything to LV
so keep LV pointer const.

10 years agocleanup: move printing after backup
Zdenek Kabelac [Mon, 22 Sep 2014 12:06:52 +0000 (14:06 +0200)]
cleanup: move printing after backup

Print successful result after making backup.
In this place we are sure to not keep memlock.

10 years agovalidation: move check for spare correctness
Zdenek Kabelac [Sun, 21 Sep 2014 09:34:50 +0000 (11:34 +0200)]
validation: move check for spare correctness

Check lv feature when we check LVs

10 years agovgchange: use NULL 'feature' of lv_info call
Zdenek Kabelac [Wed, 24 Sep 2014 08:01:14 +0000 (10:01 +0200)]
vgchange: use NULL 'feature' of lv_info call

When NULL is passed for info the call itself
already does the same evaluation.

10 years agovgchange: add sync point
Zdenek Kabelac [Sun, 21 Sep 2014 21:22:23 +0000 (23:22 +0200)]
vgchange: add sync point

Before leaving _activate_lvs_in_vg() wait till devices
are active - so we do not print message about active
devices earlier then it really happens for a user.

10 years agothin and cache: improve conversion validation
Zdenek Kabelac [Mon, 22 Sep 2014 12:15:13 +0000 (14:15 +0200)]
thin and cache: improve conversion validation

More validations before any thin or cache related conversion begins.

We allow to use and stack:

pool data: cache or raid
pool metadata: raid

pool:  linear, striped
cache: linear, striped, raid
thin(extorig): linear, origin, cow, virtual, thin

10 years agothin: no pool can be used for external origins
Zdenek Kabelac [Mon, 22 Sep 2014 12:09:55 +0000 (14:09 +0200)]
thin: no pool can be used for external origins

Cache pool can't be external origin either.
For simplicity use vg from passed LV.

10 years agosnapshot: use lv_update_and_reload
Zdenek Kabelac [Sat, 20 Sep 2014 23:10:53 +0000 (01:10 +0200)]
snapshot: use lv_update_and_reload

10 years agosnapshot: add missing vg_revert
Zdenek Kabelac [Sat, 20 Sep 2014 23:10:06 +0000 (01:10 +0200)]
snapshot: add missing vg_revert

Error path missed vg_revert call.

10 years agomirror: extend adjusted_mirror_region_size API
Zdenek Kabelac [Mon, 22 Sep 2014 13:54:33 +0000 (15:54 +0200)]
mirror: extend adjusted_mirror_region_size API

We use adjusted_mirror_region_size() in two different contexts.

Either on command line -
 here we do want to inform user about reduction of size.

Or in pvmove activation context -
 here we should only use 'verbose' info.

10 years agolv_update_and_reload: use proper lock holder
Zdenek Kabelac [Mon, 22 Sep 2014 11:57:47 +0000 (13:57 +0200)]
lv_update_and_reload: use proper lock holder

When requesting to reload an LV imrove this API to
automatically reload its lock holding LV as in cluster
only top-level LVs are addressable with lock.

10 years agolv_ondisk: option search for lv without vg_ondisk
Zdenek Kabelac [Sun, 21 Sep 2014 21:10:04 +0000 (23:10 +0200)]
lv_ondisk: option search for lv without vg_ondisk

When vg_ondisk is NULL we do not need to search
through the whole VG to find out the same LV.

NOTE: as of now - VG locking is not enabled as some code parts
are breaking memory locking rules (lvm2app).

Once we enforce VG locking for read-only commands the effect
will be much better for larger VGs.

10 years agoactivate: lv_check_not_in_use no check of closed
Zdenek Kabelac [Sun, 21 Sep 2014 21:07:02 +0000 (23:07 +0200)]
activate: lv_check_not_in_use no check of closed

Don't perform expensive sysfs tests when the device is closed.
(having open_count == 0).

10 years agofix: regression for recent persistent commit
Zdenek Kabelac [Fri, 19 Sep 2014 15:05:35 +0000 (17:05 +0200)]
fix: regression for recent persistent commit

Do not let fly metadata with just 'minor' set
(since they would not be readable on older version)

Be permissive with invalid major/minor number and
just report them as problem, but allow to use
such metadata with default major:minor.

10 years agocleanup: use int32 for major minor
Zdenek Kabelac [Fri, 19 Sep 2014 15:04:28 +0000 (17:04 +0200)]
cleanup: use int32 for major minor

Use consistently int32_t for major, minor.

10 years agocache: fix regression and invert test
Zdenek Kabelac [Fri, 19 Sep 2014 14:16:36 +0000 (16:16 +0200)]
cache: fix regression and invert test

Last commit c710f02e0181cc2db5455f0c98033247a70ecc30
converting code to use lv_update_and_reload()
intoduced invalid test for error result.
Fix it and properly check for  if (!...)

10 years agodebug: enhance mmap catch code
Zdenek Kabelac [Fri, 19 Sep 2014 09:04:36 +0000 (11:04 +0200)]
debug: enhance mmap catch code

Use nice instruction_HLT macro
Use log_debug_mem()
Don't actually log things after we prohibit 'mmap'.
Move initialization of strerror & udev before blocking mmap.

10 years agoman: document obsoleted options
Zdenek Kabelac [Fri, 19 Sep 2014 12:53:14 +0000 (14:53 +0200)]
man: document obsoleted options

It's shown on comand line help and it's accepted argument,
so provide matching man entry.

10 years agobackup: drops locked memory
Zdenek Kabelac [Fri, 19 Sep 2014 13:31:41 +0000 (15:31 +0200)]
backup: drops locked memory

Since we want to backup metadata, this is the point
we no longer want to hold memory locked.

10 years agocleanup: lvchange remove some extra code.
Zdenek Kabelac [Fri, 19 Sep 2014 13:10:21 +0000 (15:10 +0200)]
cleanup: lvchange remove some extra code.

We do not need to restore LV content on error path - since
for reactivation we always use  ondisk/commited metadata,
so passed data are never used.

Drop some unneded extra message, since the called function
repeated logs same info.

10 years agolvchange: backup final metadata
Zdenek Kabelac [Fri, 19 Sep 2014 13:16:26 +0000 (15:16 +0200)]
lvchange: backup final metadata

Shift backup after final metadata commit.

Synchronize with wiping.

10 years agotools: common handling of --persistent option
Zdenek Kabelac [Fri, 19 Sep 2014 12:57:02 +0000 (14:57 +0200)]
tools: common handling of --persistent option

Move common code for reading and processing
of --persistent arguments for lvcreate and lvchange
into lvmcmdline.

Reuse validate_major_minor() routine for validation.

Don't blindly activate LVs after change in cluster
and instead only local reactivation is supported.
(we have now many limited targets now).

Dropping 'sigint_caught()' handling, since
prompt() is resolving this case itself.

10 years agometadata: validate major, minor numbers
Zdenek Kabelac [Fri, 19 Sep 2014 12:51:41 +0000 (14:51 +0200)]
metadata: validate major, minor numbers

Validate major, minor numbers after reading them from metadata.

10 years agocleanup: use const for cmd context
Zdenek Kabelac [Fri, 19 Sep 2014 12:29:12 +0000 (14:29 +0200)]
cleanup: use const for cmd context

10 years agocleanup: switch to use CHANGE_AEY
Zdenek Kabelac [Fri, 19 Sep 2014 12:28:28 +0000 (14:28 +0200)]
cleanup: switch to use CHANGE_AEY

Since for other enums we use 'Y' or 'N' use it with 'AE' as well.

10 years agowipe_lv: move sync_local_dev_names in front
Zdenek Kabelac [Fri, 19 Sep 2014 09:06:31 +0000 (11:06 +0200)]
wipe_lv: move sync_local_dev_names in front

Synchronize things before checking for locally active volume.

10 years agomemlock: drop uneeded lock
Zdenek Kabelac [Thu, 18 Sep 2014 23:09:36 +0000 (01:09 +0200)]
memlock: drop uneeded lock

Avoid doing buffered operation within memory lock.

10 years agomemlock: ensure memory is allocation before locking
Zdenek Kabelac [Thu, 18 Sep 2014 23:07:32 +0000 (01:07 +0200)]
memlock: ensure memory is allocation before locking

strerror may mmap ram if it was not yet used.
dm_udev_get_sync_support  may initilize udev if it was still not used.

10 years agodebug: mmap traps mmap and mmap64 on i386
Zdenek Kabelac [Thu, 18 Sep 2014 22:59:46 +0000 (00:59 +0200)]
debug: mmap traps mmap and mmap64 on i386

Add code to trap both mmap implementation on 32bit arch.
Use dlsym()
Use hlt instraction instead of int3 - generates usable stack trace
when problem is catched.

10 years agoWHATS_NEW
Zdenek Kabelac [Thu, 18 Sep 2014 16:19:16 +0000 (18:19 +0200)]
WHATS_NEW

10 years agomakefiles: fix linking of PIE code
Zdenek Kabelac [Thu, 18 Sep 2014 16:14:21 +0000 (18:14 +0200)]
makefiles: fix linking of PIE code

PIE documentation:
:
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
http://lfs.osuosl.org/hlfs/view/unstable/glibc/chapter02/pie.html

suggest to suply -fPIE (or -fpie) with -pie
during executable compilation.

When -fPIC and -fPIE are used together - -fPIE wins

Drop usage of -DPIE - we are not using this flag anywhere

TODO: cleanup linking flags

10 years agodebug: enhance trap of mmap
Zdenek Kabelac [Thu, 18 Sep 2014 14:56:13 +0000 (16:56 +0200)]
debug: enhance trap of mmap

Don't install trap for mlockall case
Add another code path for -fPIE compilation,
in this case the address of mmap function is 'plt' address.

10 years agocleanup: update message
Zdenek Kabelac [Wed, 17 Sep 2014 22:53:42 +0000 (00:53 +0200)]
cleanup: update message

10 years agodebug: catch mmap with -DDEBUG_MEMLOCK
Zdenek Kabelac [Wed, 17 Sep 2014 22:40:45 +0000 (00:40 +0200)]
debug: catch mmap with -DDEBUG_MEMLOCK

10 years agocleanup: detect unsupported options earlier
Zdenek Kabelac [Wed, 17 Sep 2014 21:31:51 +0000 (23:31 +0200)]
cleanup: detect unsupported options earlier

Avoid unnecessary converions of pool.

10 years agocache: Enable cache segment type by default.
Alasdair G Kergon [Wed, 17 Sep 2014 22:13:15 +0000 (23:13 +0100)]
cache: Enable cache segment type by default.

10 years agolvconvert: Further restrictions on cache/pools.
Alasdair G Kergon [Wed, 17 Sep 2014 22:00:41 +0000 (23:00 +0100)]
lvconvert: Further restrictions on cache/pools.

Would be better to define what is supported not what isn't, but this'll
have to do for now.

10 years agolvconvert: Disallow mixing of cache and thin pools.
Alasdair G Kergon [Wed, 17 Sep 2014 16:11:01 +0000 (17:11 +0100)]
lvconvert: Disallow mixing of cache and thin pools.

--cachepool can't take a thin pool and --thinpool can't take a
cache pool.

10 years agolvconvert: Restrict use of cache LVs.
Alasdair G Kergon [Wed, 17 Sep 2014 15:41:58 +0000 (16:41 +0100)]
lvconvert: Restrict use of cache LVs.

Refuse use of -m and -s with cache LVs until full support
can be provided.

10 years agocleanup: Remove metadata.h from tools dir.
Alasdair G Kergon [Wed, 17 Sep 2014 14:50:24 +0000 (15:50 +0100)]
cleanup: Remove metadata.h from tools dir.

metadata.h is meant to be internal to the library.
metadata-exported.h contains the things needed by tools.

10 years agovgchange: support clustered conversion for active lv
Zdenek Kabelac [Wed, 17 Sep 2014 12:27:46 +0000 (14:27 +0200)]
vgchange: support clustered conversion for active lv

If we want to support conversion of VG to clustered type,
we currently need to relock active LV to get proper DLM lock.

So add extra loop after change of VG clustered attribute
to exlusively activate all active top level LVs.

When doing change -cy -> -cn  we should validate LVs are not
active on other cluster nodes - we could be sure about this only
when with local exclusive activation - for other types
we require user to deactivate volumes first.

As a workaround for this limitation there is always
locking_type = 0 which amongs other skip the detection
of active LVs.

FIXME:
 clvmd should handle looks for cluster locking type all the time.

10 years agolocking: add locking_supports_remote_queries
Zdenek Kabelac [Wed, 17 Sep 2014 12:21:41 +0000 (14:21 +0200)]
locking: add locking_supports_remote_queries

Add function to detect whether locking could be used to
query for lock type so we could recognize exclusive
activation.

10 years agocache-pool: Fix specification of cachemode when converting to cache-pool
Jonathan Brassow [Wed, 17 Sep 2014 03:19:53 +0000 (22:19 -0500)]
cache-pool:  Fix specification of cachemode when converting to cache-pool

Failure to copy the 'feature_flags' lvconvert_param to the matching
lv_segment field meant that when a user specified the cachemode argument,
the request was not honored.

10 years agoclean-up: better macro usage
Jonathan Brassow [Wed, 17 Sep 2014 02:24:14 +0000 (21:24 -0500)]
clean-up:  better macro usage

Use 'lv_is_mirror' instead of 'lv_is_mirrored && !lv_is_raid' - both
are the same as asking if the non-RAID mirror implementation is being
used.

10 years agovgchange: disable cluster convert for active LVs
Zdenek Kabelac [Tue, 16 Sep 2014 09:41:28 +0000 (11:41 +0200)]
vgchange: disable cluster convert for active LVs

While we could probably reacquire some type of lock when
going from non-clustered to clustered vg, we don't have any
single road back to drop the lock and keep LV active.

For now keep it safe and prohibit conversion when LV
is active in the VG.

10 years agova_list: properly pass va_list through functions
Zdenek Kabelac [Mon, 15 Sep 2014 13:33:56 +0000 (15:33 +0200)]
va_list: properly pass va_list through functions

Code should not just pass va_list arg through the function
as args could be passed in many strange ways.
Use va_copy().

For details look in i.e.:

http://julipedia.meroh.net/2011/09/using-vacopy-to-safely-pass-ap.html

10 years agodevices: Detect rotational devices.
Alasdair G Kergon [Mon, 15 Sep 2014 23:44:25 +0000 (00:44 +0100)]
devices: Detect rotational devices.

Add dev_is_rotational() for future use by allocation code.

10 years agomirrors: Fix checks for mirror/raid/pvmove LVs.
Alasdair G Kergon [Mon, 15 Sep 2014 23:13:46 +0000 (00:13 +0100)]
mirrors: Fix checks for mirror/raid/pvmove LVs.

Try to enforce consistent macro usage along these lines:

lv_is_mirror - mirror that uses the original dm-raid1 implementation
               (segment type "mirror")
lv_is_mirror_type - also includes internal mirror image and log LVs

lv_is_raid - raid volume that uses the new dm-raid implementation
             (segment type "raid")
lv_is_raid_type - also includes internal raid image / log / metadata LVs

lv_is_mirrored - LV is mirrored using either kernel implementation
                 (excludes non-mirror modes like raid5 etc.)

lv_is_pvmove - internal pvmove volume

10 years agocmirror: fix endian issues on s390
Liuhua Wang [Sat, 13 Sep 2014 07:08:28 +0000 (02:08 -0500)]
cmirror: fix endian issues on s390

Cmirrord has endian bugs, which cause failure to lvcreate a mirrored lv
on s390.
- data_size is uint32, should not use xlate64 to convert, which will
  cause data_size 0 after xlate.
- request_type and data_size still used by local(v5_data_switch),
  should convert later.  If request_type xlate too early, it will
  cause request_type judge error; if data_size xlate too early, it
  will cause coredump in case DM_ULOG_CLEAR_REGION.
- when receiving package in clog_request_from_network. vp[0] will always
  be little endian.  We could use xlate64(vp[0]) == vp[0] to decide if
  the local node is little endian or not.

Signed-off-by: Lidong Zhong<lzhong@suse.com> & Liuhua Wang <lwang@suse.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
10 years agocleanup: fix last commit
Alasdair G Kergon [Mon, 15 Sep 2014 21:04:14 +0000 (22:04 +0100)]
cleanup: fix last commit

10 years agocleanup: Use lv_is_ macros.
Alasdair G Kergon [Mon, 15 Sep 2014 20:33:53 +0000 (21:33 +0100)]
cleanup: Use lv_is_ macros.

Use lv_is_* macros throughout the code base, introducing
lv_is_pvmove, lv_is_locked, lv_is_converting and lv_is_merging.

lv_is_mirror_type no longer includes pvmove.

10 years agotests: update lv_no_exists
Zdenek Kabelac [Mon, 15 Sep 2014 11:45:43 +0000 (13:45 +0200)]
tests: update lv_no_exists

On successful exit path remove debug.log file.

10 years agotest: test there is no leak of LV on error path
Zdenek Kabelac [Mon, 15 Sep 2014 11:44:41 +0000 (13:44 +0200)]
test: test there is no leak of LV on error path

10 years agothin: check for active lv
Zdenek Kabelac [Mon, 15 Sep 2014 11:42:43 +0000 (13:42 +0200)]
thin: check for active lv

Before calling deactivate, check the lv is actually active,
as we may reach this 'bad' error path with pool_lv inactive.

10 years agoWHATS_NEW for filter-related changes
Petr Rockai [Sat, 13 Sep 2014 15:34:13 +0000 (17:34 +0200)]
WHATS_NEW for filter-related changes

10 years agolibdm: finish the comment
Peter Rajnoha [Fri, 12 Sep 2014 13:35:57 +0000 (15:35 +0200)]
libdm: finish the comment

10 years agolibdm: fix dm_is_dm_major to not issue error about missing /proc lines for dm module.
Peter Rajnoha [Fri, 12 Sep 2014 13:17:57 +0000 (15:17 +0200)]
libdm: fix dm_is_dm_major to not issue error about missing /proc lines for dm module.

This is probably better approach than 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1.

If dm module is not loaded during dm_is_dm_major call, there are no
lines for dm in /proc/devices, of course. Normally, dm_is_dm_major
is called to check existing devices, hence if module is not loaded,
we can expect there's no DM device present at the same time so we
can directly return 0 here (meaning the major number being inspected
is not dm device's one).

See also https://bugzilla.redhat.com/show_bug.cgi?id=1059711.

10 years agorevert: commit 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1
Peter Rajnoha [Fri, 12 Sep 2014 13:16:08 +0000 (15:16 +0200)]
revert: commit 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1

There's a better solution to this...

10 years agocleanup: skip unused assign
Zdenek Kabelac [Fri, 12 Sep 2014 09:39:31 +0000 (11:39 +0200)]
cleanup: skip unused assign

Reset of tmp_names is only needed in else{} path.

10 years agocleanup: avoid strlen() we know max size
Zdenek Kabelac [Fri, 12 Sep 2014 09:35:51 +0000 (11:35 +0200)]
cleanup: avoid strlen() we know max size

Just use max NAME_LEN size buffer and copy the name.

10 years agocleanup: simplify _extract_image_components
Zdenek Kabelac [Thu, 11 Sep 2014 20:55:12 +0000 (22:55 +0200)]
cleanup: simplify _extract_image_components

Reorder test - first check for writable flag and then allocate.

10 years agocleanup: missing error message
Zdenek Kabelac [Thu, 11 Sep 2014 21:32:54 +0000 (23:32 +0200)]
cleanup: missing error message

10 years agocleanup: better error messages
Zdenek Kabelac [Thu, 11 Sep 2014 21:32:37 +0000 (23:32 +0200)]
cleanup: better error messages

10 years agoraid: destroy allocation handle on error path
Zdenek Kabelac [Fri, 12 Sep 2014 09:37:01 +0000 (11:37 +0200)]
raid: destroy allocation handle on error path

Don't leak ah memory pool on error path.

10 years agocleanup: update _alloc_image_component function
Zdenek Kabelac [Fri, 12 Sep 2014 09:48:41 +0000 (11:48 +0200)]
cleanup: update _alloc_image_component function

Return allocated volume directly instead of 1/0.

10 years agocleanup: plain code reindent
Zdenek Kabelac [Thu, 11 Sep 2014 18:08:56 +0000 (20:08 +0200)]
cleanup: plain code reindent

Just simple reindent and brace changes.

10 years agodebug: add missing stack trace on error path
Zdenek Kabelac [Thu, 11 Sep 2014 18:11:44 +0000 (20:11 +0200)]
debug: add missing stack trace on error path

10 years agoraid: use _generate_raid_name
Zdenek Kabelac [Fri, 12 Sep 2014 09:39:48 +0000 (11:39 +0200)]
raid: use _generate_raid_name

Use new function to get implicit name validation
(so we do not exit with internal error on metadata validation).

10 years agoraid: add function for name creation
Zdenek Kabelac [Fri, 12 Sep 2014 09:30:00 +0000 (11:30 +0200)]
raid: add function for name creation

Add name for construction and validation of raid subvolume
name with a given suffix.

TODO: check if reusable for mirrors as well.

10 years agoraid: check result of get_segtype_from_string
Zdenek Kabelac [Fri, 12 Sep 2014 09:48:51 +0000 (11:48 +0200)]
raid: check result of get_segtype_from_string

Error here is rather highly unpexpected for these types, but
stay consistent with rest of the code and don't use unchecked value.

10 years agoraid: add missing archive call
Zdenek Kabelac [Fri, 12 Sep 2014 09:30:38 +0000 (11:30 +0200)]
raid: add missing archive call

Before starting to update raid metadata, archive existing unmodified one.

10 years agoraid: add missing vg_revert
Zdenek Kabelac [Thu, 11 Sep 2014 17:58:28 +0000 (19:58 +0200)]
raid: add missing vg_revert

After failing vg_write() and suspend_lv() there was missing vg_revert() call.

This page took 0.070515 seconds and 5 git commands to generate.