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

10128 Commits

Author SHA1 Message Date
Alasdair G Kergon
d0837dcceb pre-release 2015-01-30 16:16:51 +00:00
Zdenek Kabelac
71e88f761d tests: add --force to sfdisk
Avoid udev sync troubles for now.
2015-01-30 16:46:06 +01:00
Zdenek Kabelac
04b60e9274 WHATS_NEW
For thin fix.
2015-01-30 16:34:19 +01:00
Zdenek Kabelac
40102ae014 thin: fix upgrade regression
Older lvm2 tools where always providing linear mapping for thin pool.
Recent lvm2 version however support external usage of thin pool and
empty/unused pools are loaded without such external linear mapping.

So this patch covers 'upgrade' problem, where older tool has activated
thin-pool with 'linear' layer mapping, and newer tools didn't expected
such mapping to exist and were not able to deactivate such table.

So before checking for new layout in dm-table, check if there is not
an old one already there.
2015-01-30 16:22:11 +01:00
Zdenek Kabelac
a29a3ed3c3 thin: report proper status for thin pool
After commit 158e998876 where we may
start to readlv_attr with a 'shared' ioctl call for a single lvs line
we where obtaing single status for thin pools.
However this is not properly reflecting lvm2 reality.

Correcting this by reading lv status from layered thin pool, but lv info
from non-layered (linear) mapped device which is maintained for proper
cluster locking.
2015-01-30 15:58:12 +01:00
Peter Rajnoha
e8aab3a7fd cleanup: conf: auxiliary_device_status_source -> external_device_info_source
auxiliary_device_status_source was name used during development
of this feature, renamed later.
2015-01-30 15:41:42 +01:00
Zdenek Kabelac
434031719e raid: check lock holding LV
Since raid could be used as stacked LV - check lock holding LV
for proper locking type for clustered usage.
2015-01-30 14:16:27 +01:00
Peter Rajnoha
c99cb20715 WHATS_NEW 2015-01-30 13:29:51 +01:00
Peter Rajnoha
28ba0450e9 cleanup: add dev-ext-udev-constants.h with constants/names of the properties/values used from udev db 2015-01-30 13:17:12 +01:00
Peter Rajnoha
1c7a509bed filters: add firmware RAID filter
Just like MD filtering that detects components of software RAID (md),
add detection for firmware RAID.

We're not adding any native code to detect this - there are lots of
firmware RAIDs out there which is just out of LVM scope. However,
with current changes with which we're able to get device info from
external sources (e.g. external_device_info_source="udev"), we can
do this easily if the external device status source has this kind
of information - which is the case of "udev" source where the results
of blkid scans are stored.

This detection should cover all firmware RAIDs that blkid can detect and
which are identified as:
  ID_FS_TYPE = {adaptec,ddf,hpt45x,hpt37x,isw,jmicron,lsi_mega,nvidia,promise_fasttrack,silicon_medley,via}_raid_member
2015-01-30 13:17:12 +01:00
Peter Rajnoha
787f6ce04a filter-partitioned: use new 'udev' device status source to get partition status
Partitioned devices are marked in udev db as:
  ID_PART_TABLE="<partition table type name>"
and at the same time they are *not* marked with:
  ID_PART_ENTRY_DISK="<parent disk major:minor>"

Where partition table type name is dos/gpt/... But checking the presence
of this variable is enough for LVM here - it just needs to know whether
there's a partition table or not, not interested in the actual type.
The same applies for parent disk major:minor.
2015-01-30 13:17:12 +01:00
Peter Rajnoha
2fc126b00d filter-usable: move check for pv_min_size from filter-partitioned to filter-usable and use new 'udev' external device info source for this check
The filter-partitioned code should contain only checks in "partition" domain.

The check for pv_min_size should actually be a part of filter-usable.
If the device size is less than pv_min_size, such device is not usable
as a PV so this check clearly belongs here logically.

With udev external info source, we can get device size via libudev's
sysfs reading interface and we can avoid opening the device this way
effectively.
2015-01-30 13:01:12 +01:00
Peter Rajnoha
9c030e81a4 filter-mpath: use new 'udev' external device info source to get mpath component status
mpath components are marked in udev db as:
  ID_FS_TYPE="mpath_member"
or
  DM_MULTIPATH_DEVICE_PATH="1"

(it depends on udev rule/blkid version used for handling mpath)
2015-01-30 13:01:12 +01:00
Peter Rajnoha
590fbd8961 filter-md: use new 'udev' external device info source to get MD component status
MD components are marked in udev db as:
  ID_FS_TYPE="linux_raid_member"
2015-01-30 13:01:12 +01:00
Peter Rajnoha
bf8943b0f6 conf: add devices/external_device_info_source to lvm.conf 2015-01-30 13:01:12 +01:00
Peter Rajnoha
c50a90c9e6 filter-composite: add external device info hooks
Composite filter is a filter that can put several filters in one set.
This patch adds a switch when creating the composite filter which will
enable or disable external device info handles for all the filters
the composite filter encompasses.

We want to use this external device info for majority of the filters
which are in the "lvmetad filter chain" (or the respective part if
we're not using lvmetad).

Following patches will use the enabled external device handle in
concrete filters from the composite filter...
2015-01-30 13:01:12 +01:00
Peter Rajnoha
fbfde21e7c device: add infrastructure to support external device info 2015-01-30 13:01:12 +01:00
Zdenek Kabelac
578b236a19 revert "cache: add pool deps for preload"
This reverts commit c3bb6d77dd.

Since we now have  for_each_sub_lv() scanning all sub LVs,
this commit could be safely reverted.
2015-01-30 12:33:52 +01:00
Zdenek Kabelac
d021284bcf tests: test stacked raid 2015-01-30 12:33:52 +01:00
Zdenek Kabelac
2055b04c11 cleanup: indent tabs 2015-01-30 12:33:52 +01:00
Zdenek Kabelac
2e35c68122 lv_manip: add for_each_sub_lv_except_pools()
for_each_sub_lv() now scans in depth also pools, however for
rename we actually do want to skip pools.

So add a new for_each_sub_lv_except_pools() to be used by rename,
every other user of for_each_sub_lv() scans every sub LV with pools
included.

This is i.e. necessary for properly working preload of pools
that are using raid arrays.
2015-01-30 12:33:52 +01:00
Peter Rajnoha
c35503e0f7 WHATS_NEW: previous commit 2015-01-30 11:28:10 +01:00
Peter Rajnoha
8650404df1 properties: also recognize LVSINFO, LVSSTATUS and LVSINFOSTATUS as subtypes of LVS
LVSINFO, LVSSTATUS and LVSINFOSTATUS is the same as LVS, just with some
extra info/status decoration attached to it. Recognize this when looking
for properties for lvm2app. This fixes lvm_lv_get_property lvm2app call
for fields which already use LVS{INFO,STATUS,INFOSTATUS} - currently,
this is lv_attr field which was converted to LVSINFOSTATUS from
pure LVS type.
2015-01-30 11:13:49 +01:00
Peter Rajnoha
531cc58d89 lvm2app: fix lvm_lv_get_attr regression causing unknown values
This is a regression from v115 where some of the fields/properties
were converted to using the common "struct lvinfo" and
"struct lv_seg_status" so we don't need to issue info and status
ioctl several times per one reported line. Not all fields are
converted yet, but one that *is* converted is the lv_attr field
with the lv_attr_dup counterpart used in lvm_lv_get_attr lvm2app fn.

These changes were introduced with e34b004422
and later - this patch introduced the "info_ok" field in the
lv_with_info_and_seg_status structure which encapsulates the lvinfo
and lv_seg_status struct.

For the lv_attr_dup, the lv_attr_dup code  missed the
assignment for the "info_ok" flag which saves the result of the
lv_info_with_seg_status call. Hence such info was marked
as unusable - unknown and it was returned as such via lvm_lv_get_attr
lvm2app fn.
2015-01-30 09:53:34 +01:00
Zdenek Kabelac
8dc1da2cbe cache: use writethrough cache_mode for older metadata
When cache_mode is undefined, the read of metadata will miss to
set a bit with mode and fails to process metadata on internal
error:

  Internal error: LV vg/lvol1 has uknown feature flags 0.

Fix it by setting it to writethrough mode.
2015-01-29 12:05:58 +01:00
Zdenek Kabelac
bfeabea631 raid: preload splitted LV only when active
Check splitted leg is active before preload.
(Since splitmirrors currently only does work active raid volumes
it's not a change for current code flow).

Minor optimization included - when already positively checked
for raid image don't check again for raid metadata.
2015-01-28 18:30:08 +01:00
Zdenek Kabelac
c3bb6d77dd cache: add pool deps for preload
for_each_sub_lv() normally does not put  pool_lv into deps.

So for now go around it in 'lv_preload()' and add explicit
call with pool.

TODO: think about a better way, we want pool_lv deps only in certain
moments, so maybe for_each_sub_lv() needs new arg for this.
2015-01-28 16:29:35 +01:00
Zdenek Kabelac
4f1309080a thin: preserve chunksize with lvconvert
When repairing thin pool or swapping thin pool metadata,
preserve  chunk_size property and avoid to be automatically changed
later in the code to better match thin pool metadata size.
2015-01-28 15:15:52 +01:00
Zdenek Kabelac
d2d3f0d747 cleanup: use macro lv_is_visible() 2015-01-28 13:45:27 +01:00
Zdenek Kabelac
553f37da71 raid: lock holder will skip visible raid LVs
RAID marks legs as VISIBLE with notion it's not longer
true raid leg - so skip tree scannig and take this LV
as top-level LV.
2015-01-28 13:45:27 +01:00
Zdenek Kabelac
93b9015760 raid: fix raid image splitting
When raid leg is extracted, now the preload code handles this state
correctly and put proper new table entry into dm tree,
so the activation of extracted leg and removed metadata works
after commit.
2015-01-28 13:45:18 +01:00
Zdenek Kabelac
b254d330e4 raid: fix tree preload for splitting raid images
When raid is being splitted, extracted leg & metadata
is still floating in the table - and thus we need to
detect this case and properly preload their matching
table so consequent activation of extracted LVs properly
renames (and FREES) existing raid images, so ongoing
image name shifting will work.
2015-01-28 13:44:06 +01:00
Alasdair G Kergon
3e11d85c77 devices: DASD doesn't need to be stackable. 2015-01-23 20:32:31 +00:00
Alasdair G Kergon
dab3ebce4c devices: Do not support unpartitioned DASD. 2015-01-23 20:01:34 +00:00
David Teigland
4f5ce1fa43 lvm.conf: update error_when_full description
Relate it to the --errorwhenfull option.
2015-01-22 13:01:02 -06:00
David Teigland
4b099d06b1 lvmthin: update monitor and autoextend
and some more in data exhaustion
2015-01-22 12:53:25 -06:00
Peter Rajnoha
0fddc5ab5c coverity: missing return value check
Reported by coverity for code added recently - _avoid_pvs_with_other_images_of_lv
which calls process_each_sub_lv and not checking return value.
2015-01-22 10:11:19 +01:00
David Teigland
e0dc3d5efb lvmthin: update data space exhaustion 2015-01-21 14:31:36 -06:00
Peter Rajnoha
bea003e94c config: improve config validation to check if setting with string value can be empty.
For example, with dmeventd/executable set to "" which is not allowed for
this setting, the config validation now ends up with:

$ lvm dumpconfig --validate
  Configuration setting "dmeventd/executable" invalid. It cannot be set to an empty value.
  LVM configuration invalid.

This check for empty values for string config settings was not
done before (we only checked empty arrays, but not scalar strings).
2015-01-21 16:44:02 +01:00
Alasdair G Kergon
57f67ce855 post-release 2015-01-21 13:25:10 +00:00
Alasdair G Kergon
fa01faaa4a pre-release 2015-01-21 13:08:12 +00:00
Alasdair G Kergon
25d906dbde dmeventd: Reduce waitevent EINTR message severity. 2015-01-21 12:54:00 +00:00
Alasdair G Kergon
7cfc9a4f64 libdevmapper: Improve incompatible version msg. 2015-01-21 12:23:56 +00:00
Peter Rajnoha
338d98be97 cleanup: for commit 7bcb3fb02d 2015-01-21 11:29:12 +01:00
Peter Rajnoha
7bcb3fb02d report: rename lv_error_when_full field to lv_when_full and display either "error", "queue" or ""
Rename original lv_error_when_full field to lv_when_full and also
convert it from binary field to string field displaying three
possible values: "error", "queueu" or "" (blank for undefined).

$ lvs vg/pool vg/pool1 vg/linear_lv -o+lv_when_full
  LV        VG   Attr       LSize Data%  Meta%  WhenFull
  linear_lv vg   -wi-a----- 4.00m
  pool      vg   twi-aotz-- 4.00m 0.00   0.98   queue
  pool1     vg   twi-a-tz-- 4.00m 0.00   0.88   error

For -S|--select these synonyms are recognized:

"error" -> "error when full", "error if no space"
"queue" -> "queue when full", "queue if no space"
   ""   -> "undefined"
2015-01-21 10:50:32 +01:00
David Teigland
5e8f362c9e lvmthin: include errorwhenfull
and don't display the size of pmspare to avoid setting an
expectation of a specific size.
2015-01-20 13:28:34 -06:00
David Teigland
a164d603d3 vgimportclone: remove arg check that uses pvs
The arg check using pvs is unnecessary.  If the arg is not a PV,
the command will just fail later.  Using the pvs command at this
point in the command is a problem when lvmetad is running, because
the pvs command does not report duplicate PVs when using lvmetad.
(Alternatively, use_lvmetad could be disabled by adding a --config
override to this pvs command.)
2015-01-20 13:08:22 -06:00
Alasdair G Kergon
404c834e14 report: Fix warning in _str_list_append.
../../lib/report/report.c: In function ‘_str_list_append’:
../../lib/report/report.c:256: warning: declaration of ‘dup’ shadows a global declaration
2015-01-20 17:15:28 +00:00
Zdenek Kabelac
87e80b6aac report: proper lv_attr_dup emulation
We need to create a mempool for proper emulation of lv_attr_dup
for lvm2api.
2015-01-20 16:24:45 +01:00
Peter Rajnoha
158e998876 report: add separate LVSINFOSTATUS field type for info+status combined fields
Add separate LVSINFOSTATUS field type for fields which display both
dm info-like and dm status-like information.

The internal interface is there with the introduction of LVSSTATUS
field type which can cope with the combination of LVSSTATUS
and LVSINFO field types (several fields).

However, till now, we considered that *single* field can display
either LVSINFO or LVSSTATUS, but not both at the same time.

Till now, we haven't had single field which needs both - hence
add LVSINFOSTATUS field type for such fields as we currently
need this for the lv_attr field which requires combination of
info and status.

This patch just adds interface for an ability to register such fields
(the code that copes with this is already in).
2015-01-20 16:10:59 +01:00