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

329 Commits

Author SHA1 Message Date
Zdenek Kabelac
b5fc0d73e5 blkdeactivate: more readable if-then-else-fi 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
dc50f2f4a0 blkdeactivate: split local declaration and assign 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
ce1383fe46 blkdeactivate: drop unused var 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
45861557b5 blkdeactivate: double quote
Using double quote to prevent globbing and word splitting.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
bd359aec86 blkdeactivate: replace obsoleted syntax 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
95ca7cfdff fsadm: make if statement more clear 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
c6a5964ce9 fsadm: add -r to read
read without -r will mangle backslashes
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
afded3e532 fsadm: no mixing string and array
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
05a6d43476 fsadm: split local var dev
Split defining of local variables from being them
assigned at the same time (lossing error code).
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
439aaca3bc fsadm: remove surrounding $()
Remove surrounding $() to avoid executing output
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
b68235c519 fsadm: fix shell globbing
Fixing reported issue for shellcheck.
Use "" properly to avoid having shell variables split.
2017-06-29 22:23:15 +02:00
Zdenek Kabelac
1c212b8a43 fsadm: restore no answer
Commit 1fe4f80e45 in current version
introduced regression for a terminal user, as he could not enter 'n'
as answer. Add missing break for this case (No whats_new).
2017-06-19 12:40:03 +02:00
Zdenek Kabelac
1fe4f80e45 fsadm: avoid hidden --yes
When 'fsadm' was running without terminal (i.e. pipe), it's been
automatically working like in '--yes'.

Detect terminal and only accept empty "" input in this mode.
2017-05-23 14:02:41 +02:00
Zdenek Kabelac
9e04e0483f fsadm: enhance detection of already mounted volumes
Add more validation to catch mainly renamed devices, where
filesystem utils are not able to handle devices properly,
as they are not addressed by major:minor by rather via some
symbolic path names which can change over time via rename operation.
2017-05-22 15:11:21 +02:00
Zdenek Kabelac
2b7ac2bfb3 fsadm: always detect mounted fs with extX
Since we add more validation to 'detect_mounted' function make sure
we always use it even with 'resize' action, so numerous validations
are not skipped.
2017-05-22 15:10:16 +02:00
Zdenek Kabelac
a1a9ae0aa5 fsadm: all path define MAJOR MINOR 2017-05-10 15:40:32 +02:00
Zdenek Kabelac
8ea33b633a fsadm: some cleanup
Put some extra "" around vars.
Indent.
Error messages with dots.
2017-05-10 15:40:31 +02:00
Zdenek Kabelac
1107d483a2 fsadm: fix test of subshell return value
Subshell is not returning error code value upward thus
error results in this case were actually ignored.
Also add dots to moved error messages.
2017-05-10 15:40:29 +02:00
Peter Rajnoha
448bf9491a lvmconf: fix systemd unit existence check for lvmconf --services --startstopservices
We have to unset the LoadState variable from previous use when we check
for systemd unit state. We use this variable to check if systemd services
are loaded or not and if it is loaded, we issue systemctl commands to
enable/disable and start/stop the service. We don't issue these commands
if the unit is not loaded to avoid error messages which may confuse users.
2017-04-05 11:06:56 +02:00
Peter Rajnoha
d90320f4f1 blkdeactivate: also unmount mount point on top of MD device if using blkdeactivate -u
The blkdeactivate script processes MD devices too so we should unmount
any mount point on top of an MD device if blkdeactivate -u|--umount is
called.

Diagnosed and reported by: Rick Warner <rick@microway.com>
See also https://bugzilla.redhat.com/show_bug.cgi?id=1410585.
2017-01-06 11:16:07 +01:00
Bryn M. Reeves
f9c9772a80 scripts: add systemd unit files to .gitignore
com.redhat.lvmdbus1.service
lvm2_lvmdbusd_systemd_red_hat.service

.gitignore
2016-12-10 17:58:10 +00:00
Bryn M. Reeves
383683ffd3 scripts: add lvmdump.sh to .gitignore 2016-12-10 17:56:56 +00:00
Peter Rajnoha
2ad66b4e7b scripts: fix comment about blk-availability init script
The original comment got there as copy-paste error and it wasn't edited
properly for blk-availability.
2016-11-25 11:30:55 +01:00
Peter Rajnoha
4585785613 blkdeactivate: deactivate dev stack if dev on top already unmounted
If blkdeactivate finds out that the device on top of device stack
is already unmounted, it still proceeds with device stack deactivation
underneath now.

This situation can happen if blkdeactivate is started and the mount
point is unmounted in parallel by chance (so when blkdeactivate
gets the the actual umount call, the device is not mounted anymore).
Before, the blkdeactivate added such device to skip list which caused
all the stack underneath to be skipped too on deactivation. Now, we
proceed just as if blkdeactivate did the umount itself.

For example, in the example below, the vg-lvol0 is mounted on /mnt/test
when blkdeactivate is called, but it gets unmounted in parallel later
on when blkdeactivate gets to the actual umount call.

Before this patch (vg-lvol0 underneath not deactivated):

  $ blkdeactivate -u
  Deactivating block devices:
    [UMOUNT]: unmounting vg-lvol0 (dm-2) mounted on /mnt/test... skipping

With this patch applied (vg-lvol0 underneath still deactivated):

  $ blkdeactivate -u
  Deactivating block devices:
    [UMOUNT]: unmounting vg-lvol0 (dm-2) mounted on /mnt/test... already unmounted
    [LVM]: deactivating Logical Volume vg/lvol0... done
2016-11-01 16:52:51 +01:00
Peter Rajnoha
0a480c5c52 systemd: disable service start rate limiting for lvm2-pvscan@.service
We shouldn't be losing pvscans just because of the fact that the
underlying device (PV) appears and disappears quickly in the system,
otherwise lvmetad may not see the device if it appears again (or it may
still keep the device in cache even it's already gone).
2016-09-27 10:48:01 +02:00
Timur Bakeyev
70be57c8da systemd: fix extra space in unit generated by lvm2-activation-generator 2016-09-26 09:54:19 +02:00
Peter Rajnoha
dbcfd59714 make: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in 2016-09-23 12:48:52 +02:00
Alasdair G Kergon
5da35d879a lvmdump: Use O_DIRECT to gather metadata. 2016-09-15 14:00:39 +01:00
Peter Rajnoha
16ed726610 lvmdump: use lsblk -s and lsblk -O in lvmdump only if these options are supported
The lsblk is just a nice helper here - it's not crucial for lvmdump so
do best effort here and use the most we can from current version of
lsblk that is installed on system. The lsblk -s option was added a bit
later after lsblk introduction and lsblk -O support even more later -
so if these are not available, use only pure lsblk output without any
extras.
2016-08-30 15:38:34 +02:00
Peter Rajnoha
19e652b182 scripts: blkdeactivate: fix typo for DEV_DIR when executing blkdeactivate -m disablequeueing 2016-07-20 13:48:59 +02:00
Peter Rajnoha
07be2b864f lvmdump: include major and minor numbers for pvs and lvs reports
Including major and minor numbers in pvs and lvs output when calling
lvmdump -a makes it a bit easier to match these items with possible
system log/journal.
2016-07-14 14:33:33 +02:00
Peter Rajnoha
42e76a1920 blkdeactivate: add -m|--mpathoption disablequeueing and use it for blk-availability systemd service and initscript
blkdeactivate -m disablequeueing causes "multipathd disablequeueing maps"
call inside blkdeactivate script before deactivating devices. This
avoids a situation where blkdeactivate may wait for paths to appear if
multipath is set to queueing and there's a stack of other devices and/or
mount points on top of such multipath device.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1344381.
2016-07-12 10:01:07 +02:00
David Teigland
ebd2758dab vgimportclone: add native command
This is cleaner and more efficient than the script.
The args and usage are unchanged.
2016-06-22 13:13:10 -05:00
Peter Rajnoha
cfdc87b623 lvmdump: also collect output from lsblk command when running lvmdump -s
lsblk provides nice and quick overview of the storage/sysfs structure
that is useful for debugging - collect its output when running lvmdump -s.
2016-06-09 13:54:15 +02:00
Peter Rajnoha
7ae05adf46 blkdeactivate: fix regression in blkdeactivate causing dm and md devices to be skipped.
Commit #5b3a4a9 caused the "name" variable to be cleared if
declaration and assignment is on two lines so put it back
so it's on one line for it to work again.
2016-06-06 14:57:46 +02:00
Peter Rajnoha
fc37ee63c0 make: add generated parts of lvmdbusd to DISTCLEAN_TARGETS for make distclean 2016-06-02 11:58:54 +02:00
Peter Rajnoha
5b3a4a9595 coverity: blkdeactivate: separate format and args for printf and declare and assign separately to avoid masking return values 2016-05-31 09:39:06 +02:00
David Teigland
591ef307b3 lvm2_activation_generator: don't create full context for liblvm2app
Don't use lvm_init() to create a full command context, which
does a lot of command setup (like connecting to daemons), which
is unnecessary for simply reading a value from lvm.conf.

Passing a NULL context arg to the lvm_config_ function is now
allowed, in which case lvm.conf is read without doing lvm
command setup.
2016-05-18 09:05:26 -05:00
Alasdair G Kergon
f19ec0e36d lvmdump: If dir exists check dir perms too. 2016-04-06 22:56:45 +01:00
Alasdair G Kergon
55001ae9ec lvmdump: Allow dir to exist already if it is empty 2016-04-06 22:36:42 +01:00
Tony Asleson
86e9d12b6f lvmdbusd: Remove --udev in service file
With commit 2d5dc6512e the dbus server
no longer needs to utilize udev to know when to update its internal
state.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2016-03-21 17:28:51 -05:00
Peter Rajnoha
6c10d1f3d9 fsadm: use stat to get major:minor pair for non-standard /dev layouts
If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).
2016-03-18 17:21:47 +01:00
Peter Rajnoha
2879eff86e fsadm: if available, use /proc/self/mountinfo to detect mounted volume
The /proc/self/mountinfo is not bound to device names like /proc/mounts
and it uses major:minor pairs instead.

This fixes a situation in which a volume is mounted and then renamed
later on - that makes /proc/mounts unreliable when detecting mounted
volumes.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1196910.
2016-03-18 13:42:06 +01:00
Peter Rajnoha
b39473a537 lvmdump: also list historical LVs in lvmdump 2016-03-03 13:50:59 +01:00
Vratislav Podzimek
3e31f51869 dbus: fix the systemd service providing the DBus service
Correct name is lvm2-lvmdbusd.service not lvmdbusd.service.
This makes the bus-activation (auto-activation) work.

Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
2016-02-26 10:20:08 +01:00
Alasdair G Kergon
5987562cf9 lvmdbus: Add new daemon. 2016-02-17 23:53:35 +00:00
Peter Rajnoha
55056c2d16 vgimportclone: fix VG name variable reference in error message after failed PV uuid change 2016-01-21 14:47:48 +01:00
Zdenek Kabelac
fcbef05aae doc: change fsf address
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Peter Rajnoha
4304a95dfd lvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s
The lvm2-activation{-early,-net}.service systemd unit statuses were missing
in dump gathered by lvmdump -s. These are quite important when debugging
scenarios with systemd environment and where lvmetad is not used.
2016-01-04 15:12:25 +01:00
Zdenek Kabelac
bbef4edd06 makefiles: switch to rpath-link
Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.
2015-10-14 00:51:55 +02:00