1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

6179 Commits

Author SHA1 Message Date
Zdenek Kabelac
0d9a4c6989 lib: new vdo segment configurable options
Configurable for vdo segment with their default values.
Also specify their ranges with minimal and maximal values.
2018-07-09 15:28:35 +02:00
Zdenek Kabelac
2e05f6018b activate: kvdo modprobe workaround
To support autoloading of VDO dm target driver loading of 'kvdo'
kernel module is needed - ATM it's not using 'dm-vdo' name.
So to support this strange name - add temporarily solution to
autoload  kvdo kernel module in this case.
2018-07-09 15:28:35 +02:00
Zdenek Kabelac
e9d1f676b3 allocation: add check for passing log allocation
Updates previous commit.
2018-07-09 00:59:34 +02:00
Zdenek Kabelac
6d1c983122 cleanup: use last_seg
More readable code.
2018-07-09 00:23:35 +02:00
Zdenek Kabelac
c8b4f9414c dev_io: no discard in testmode
When lvm2 command is executed in test mode, discard ioctl is skipped.
This may cause even data-loose in case, issuing discard for released
areas was enabled and user 'tested'  lvreduce.
2018-07-09 00:19:30 +02:00
Zdenek Kabelac
b697aa9646 allocator: fix thin-pool allocation
When allocating thin-pool with more then 1 device - try to
allocate 'metadataLV' with reuse of log-type allocation for mirror LV.
It should be naturally place on other device then 'dataLV'.

However due to somewhat hard to follow allocation logic code,
it's been rejected allocation in cases where there was not
enough space for data or metadata on single PV, thus to successed,
usage of segments was mandatory.

While user may use:

allocation/thin_pool_metadata_require_separate_pvs=1

to enforce separe meta and data LV - on default settings, this is not
enable thus segment allocation is meant to work.

NOTE:

As already said - the original intention of this whole  'if()' is unclear,
so try to split this test into multiple more simple tests that are more readable.

TODO: more validation.
2018-07-09 00:19:30 +02:00
Zdenek Kabelac
f2b856c994 lv_manip: do not check extents for any virtual target
Allow creation of any virtual segment type with just --virtualsize
specified without any real extent size give.

TODO: likely --type error,zero might be later enhanced to use -V
(along with -L) - but since those targets do not allocate real
space, supporting -V makes sense with them.
2018-07-02 10:24:23 +02:00
Zdenek Kabelac
2bb9627d01 lv_manip: add name of failing LV into error message 2018-07-02 10:24:23 +02:00
Zdenek Kabelac
ed3428b7ed memlock: extend exception list
Amound of linked libraries grows.
Most of them we don't need to lock in, since we are not using
them in locked section, so skip locking them in memory.
2018-07-02 10:24:20 +02:00
Zdenek Kabelac
0bae9a1bff locking: memory locking ONLY with suspending reason
It's important to lock memory beforo running SUSPEND ioctl - but whole
lvm preload runs in memory unlocked environment - as in this phase
memory allocation is allowed and is meant to happen.

Once all targets are preload and ready (confirmed from all targets)
we start suspending tree - and here the memory allocation (or i.e.
opening files) is no longer allowed - as it may cause kernel deadlock.
2018-07-02 10:21:42 +02:00
Marian Csontos
a14f21bf1d bcache: Fix null pointer dereferencing 2018-06-26 17:04:18 +02:00
Zdenek Kabelac
cea88a9e4e lv_manip: use vgmem pool
Switch to vgmem pool for allocation associated with modification
of particular VG.
2018-06-25 15:07:55 +02:00
Zdenek Kabelac
357e9f9572 cache: use new api function 2018-06-25 15:07:55 +02:00
Zdenek Kabelac
9c0d92d957 lv_manip: add new internal api function 2018-06-25 15:07:55 +02:00
Zdenek Kabelac
8949903fbb cache: set areas count prior using it
Set correct counter, so it's not failing on internal error check.
2018-06-25 15:07:32 +02:00
Zdenek Kabelac
106ee05ba0 lv_manip: add extra internal error
Catch error early, when trying to store data into non-allocated area.
2018-06-22 23:37:02 +02:00
Zdenek Kabelac
6c84a36b53 utils: add clzll
Check for __builtin_clzll and add wrapper when missing.
2018-06-22 23:37:02 +02:00
Zdenek Kabelac
c728d88e11 build: include configure.h
It's important to consistenly include  configure.h as the 1st. header.
It containts #defines influencing behavior of other included header
files.
2018-06-22 23:11:44 +02:00
David Teigland
dd7ebec120 filter: use pointers to real addresses
instead of casting values 1 and 2 to pointers
which gcc optimization can have problems with.
2018-06-21 10:54:43 -05:00
David Teigland
15826214f9 Remove code for using files as devices
It appears this has not been used in a long time,
and it seems to have no point since loop devices exist.
2018-06-21 09:33:21 -05:00
David Teigland
e166d2b14c lvmlockd: fix another missing lock_type null check
Same as 347c807f8.
2018-06-21 09:24:51 -05:00
David Teigland
42f7caf1c2 scan: work around udev problems by avoiding open RDWR
udev creates a train wreck of events if we open devices
with RDWR.  Until we can fix/disable/scrap udev, work around
this by opening RDONLY and then closing/reopening RDWR when
a write is needed.  This invalidates the bcache blocks for
the device before writing so it can trigger unnecessary
rereading.
2018-06-20 14:08:12 -05:00
David Teigland
f85a010a6b bcache: remove extraneous error message
an error from io_submit is already recognized by
the caller like errors during completion.
2018-06-18 12:02:22 -05:00
David Teigland
428514a07f Drop --ignoreskippedcluster option
It's no longer needed.  Clustered VGs are now handled in
the same way as foreign VGs, and as shared VGs that
can't be accessed:

- A command processing all VGs sees a clustered VG,
  prints a message ("Skipping clustered VG foo."),
  skips it, and does not fail.

- A command where the clustered VG is explicitly
  named on the command line, prints a message and fails.
  "Cannot access clustered VG foo, see lvmlockd(8)."

The option is listed in the set of ignored options for
the commands that previously accepted it.  (Removing it
entirely would cause commands/scripts to fail if they
set it.)
2018-06-15 15:59:34 -05:00
David Teigland
ccab4a1994 report: show empty lock_type for none
Sometimes lock_type would be displayed as "none"
(after changing it) and sometimes as empty.
Make it consistently empty.
2018-06-15 14:14:39 -05:00
David Teigland
328303d4d4 Remove unused device error counting 2018-06-15 14:04:39 -05:00
David Teigland
54f61e7dcc config: add deprecated version for recently removed settings
assumes that the next version from this branch is 3.0.0
2018-06-15 13:56:26 -05:00
David Teigland
3fd75d1bcd scan: use full md filter when md 1.0 devices are present
The md filter can operate in two native modes:
- normal: reads only the start of each device
- full: reads both the start and end of each device

md 1.0 devices place the superblock at the end of the device,
so components of this version will only be identified and
excluded when lvm uses the full md filter.

Previously, the full md filter was only used in commands
that could write to the device.  Now, the full md filter
is also applied when there is an md 1.0 device present
on the system.  This means the 'pvs' command can avoid
displaying md 1.0 components (at the cost of doubling
the i/o to every device on the system.)

(The md filter can operate in a third mode, using udev,
but this is disabled by default because there have been
problems with reliability of the info returned from udev.)
2018-06-15 12:21:25 -05:00
David Teigland
8eab37593e Add cmd arg to more functions
so that it can be used in the filter code
2018-06-15 11:03:55 -05:00
David Teigland
e53cfc6a88 lvmlockd: update method for changing clustered VG
The previous method for forcibly changing a clustered VG
to a local VG involved using -cn and locking_type 0.
Since those options are deprecated, replace it with
the same command used for other forced lock type changes:
vgchange --locktype none --lockopt force.
2018-06-13 15:30:28 -05:00
David Teigland
22c5467add filters: remove cache file in persistent filter
It creates problems because it's not always correct,
and it doesn't actually help much.
2018-06-13 14:00:47 -05:00
David Teigland
17f5572bc9 Remove independent metadata areas
in which metadata is stored in files on the local fs
instead of on PVs.
2018-06-13 12:25:19 -05:00
David Teigland
9df6f601e0 Remove code for loading other metadata formats
other formats are not used.
2018-06-13 12:03:42 -05:00
David Teigland
be3af7f93e Remove the unused lock_hash in lvmcache
It kept track of which VGs were locked, but is
no longer used, so remove it.
2018-06-12 11:29:56 -05:00
David Teigland
981a3ba98e Clean up repair and result values in vg_read
Fix the confusing mix of input and output values
in the single variable.
2018-06-12 11:08:26 -05:00
David Teigland
9a8c36b891 Fix use of orphan lock in commands
vgreduce, vgremove and vgcfgrestore were acquiring
the orphan lock in the midst of command processing
instead of at the start of the command.  (The orphan
lock moved to being acquired at the start of the
command back when pvcreate/vgcreate/vgextend were
reworked based on pvcreate_each_device.)

vgsplit also needed a small update to avoid reacquiring
a VG lock that it already held (for the new VG name).
2018-06-12 09:46:11 -05:00
David Teigland
c4153a8dfc Remove checking for locked VGs
A few places were calling a function to check if a
VG lock was held.  The only place it was actually
needed is for pvcreate which wants to do its own
locking (and scanning) around process_each_pv.

The locking/scanning exceptions for pvcreate in
process_each_pv/vg_read can be enabled by just passing
a couple of flags instead of checking if the VG is
already locked.  This also means that these special
cases won't be enabled unknowingly in other places
where they shouldn't be used.
2018-06-12 09:46:04 -05:00
David Teigland
3b6b7f8f9b lvmlockd: skip repair lock upgrade for non shared vgs
Only attempt lvmlockd lock upgrade for shared VGs.
2018-06-12 09:44:05 -05:00
Zdenek Kabelac
77d5caae90 snapshot: improve checking of merging snapshot
Add runtime detection for 'lvs -o+seg_monitor' and 'vgchange --monitor'.
This fix should avoid unnecessary timeout on systemd shutdown.
2018-06-11 22:25:42 +02:00
David Teigland
b48e10d9e6 Remove lvmcache CACHE_LOCKED flag
and the functions that set it.  It's no longer used.
2018-06-08 15:11:47 -05:00
David Teigland
ebd147ff24 Remove locking for non-vgs
Locks for VGs are the only thing that locking.[ch]
now handles, so references to other variations
can be removed.
2018-06-08 14:34:50 -05:00
David Teigland
1c59140f5f Remove unused cluster-related locking flags 2018-06-08 14:01:00 -05:00
David Teigland
a8759dc7a6 Remove unused cache management from locking
This code was for managing lvmcache for clvm
and it no longer does anything.
2018-06-08 12:30:43 -05:00
David Teigland
5e672df6ae Removing locking layer from sync_local_dev_names
the indirection is not needed without clvm
2018-06-08 12:18:57 -05:00
David Teigland
669b1295ae Remove header declarations for removed functions 2018-06-08 10:01:05 -05:00
David Teigland
73b7e6fde7 Remove more code that was only used by liblvm2app 2018-06-08 09:29:11 -05:00
Joe Thornber
7c4b19c335 Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
Joe Thornber
d5da55ed85 device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind.  These days there's just
no need.
2018-06-08 13:40:53 +01:00
Zdenek Kabelac
bc8c8d2f87 build: drop exported symbols
This libs are no longer possible to create,
drop maintanence of exported symbols.
2018-06-08 14:37:31 +02:00
Zdenek Kabelac
5cb4b2a424 cache: cleaner policy also uses fmt2
Format 2 is also with cleaner policy.
2018-06-08 14:37:29 +02:00