master - Test (RAID): Test for RAID10 activations when devices are missing
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a3cfe9d9b7d77d...
Commit: a3cfe9d9b7d77d2641b052c33316fda71d05b0d7
Parent: 2be83f45431313947619ac57e9554c59621c371b
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Jan 28 12:32:33 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Jan 28 12:32:33 2013 -0600
Test (RAID): Test for RAID10 activations when devices are missing
Test the fix for bug 889358. RAID10 had been failing to activate when
there were devices that had failed in more than one mirror set.
---
test/shell/lvchange-partial.sh | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvchange-partial.sh b/test/shell/lvchange-partial.sh
index fe642d4..bc9a514 100644
--- a/test/shell/lvchange-partial.sh
+++ b/test/shell/lvchange-partial.sh
@@ -13,7 +13,7 @@
aux target_at_least dm-raid 1 1 0 || skip
-aux prepare_vg 2
+aux prepare_vg 4
lvcreate --type raid1 -m 1 -l 2 -n $lv1 $vg
lvchange -an $vg/$lv1
@@ -64,3 +64,17 @@ not lvchange --zero y $vg/$lv1
not lvchange --resync -ay $vg/$lv1
not lvchange --resync --addtag foo $vg/$lv1
+aux enable_dev "$dev1"
+lvremove -ff $vg
+
+# rhbz 889358
+# Should be able to activate when RAID10
+# has failed devs in different mirror sets.
+if aux target_at_least dm-raid 1 3 2; then
+ lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
+ aux wait_for_sync $vg $lv1
+ lvchange -an $vg/$lv1
+ aux disable_dev "$dev1" "$dev3"
+ lvchange -ay $vg/$lv1 --partial
+ lvchange -an $vg/$lv1
+fi
10 years, 10 months
master - blkdeactivate: prevent trying to unmount the same mountpoint more times
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2be83f45431313...
Commit: 2be83f45431313947619ac57e9554c59621c371b
Parent: f7da1caf8deaf50e0597ec377fb035ea3de1ac36
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 23 16:57:44 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 23 16:57:44 2013 +0100
blkdeactivate: prevent trying to unmount the same mountpoint more times
An addendum to previous commit 1052863a1b35f7488758c78b3a9ebef5c63392bc.
---
scripts/blkdeactivate.sh.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index 849c61d..be00c24 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -39,7 +39,7 @@ LVM="@sbindir@/lvm"
LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
LSBLK_VARS="local devtype local kname local name local mnt"
LSBLK_READ="read -r devtype kname name mnt"
-SORT_MNT="/bin/sort -r -k 4"
+SORT_MNT="/bin/sort -r -u -k 4"
# Do not unmount mounted devices by default.
DO_UMOUNT=0
10 years, 10 months
master - blkdeactivate: fix handling of nested mountpoints and mangled mount paths.
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f7da1caf8deaf5...
Commit: f7da1caf8deaf50e0597ec377fb035ea3de1ac36
Parent: 8bcc1da2f3f8e5f62af7b9e3a0967f7d1a60b582
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Jan 23 14:45:41 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Jan 23 14:45:41 2013 +0100
blkdeactivate: fix handling of nested mountpoints and mangled mount paths.
If there was a nested mountpoint inside an existing mount path,
blkdeactivate could fail to unmount such a mountpoint as it
needs to deactivate the deepest path first and continue upwards.
For example the simplest reproducer:
[root@rhel6-a ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 4G 0 disk
|-vg-lvol0 (dm-2) 253:2 0 32M 0 lvm /mnt/a
`-vg-lvol1 (dm-3) 253:3 0 32M 0 lvm /mnt/a/b
Before this patch:
[root@rhel6-a ~]# blkdeactivate -u
Deactivating block devices:
UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/a
umount: /mnt/a: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
UMOUNT: unmounting vg-lvol1 (dm-3) mounted on /mnt/a/b
LVM: deactivating Logical Volume vg/lvol1
(deactivation of vg/lvol0 is skipped as /mnt/a that is on lvol0
can't be unmounted - it still has /mnt/a/b as nested mountpoint!)
With this patch applied:
[root@rhel6-a ~]# blkdeactivate -u
Deactivating block devices:
UMOUNT: unmounting vg-lvol1 (dm-3) mounted on /mnt/a/b
UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/a
LVM: deactivating Logical Volume vg/lvol0
LVM: deactivating Logical Volume vg/lvol1
===
Also, this patch contains a fix for processing mangled mount paths:
[root@rhel6-a ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 4G 0 disk
`-vg-lvol0 (dm-2) 253:2 0 32M 0 lvm /mnt/x y z
[root@rhel6-a ~]# lsblk -r
vg-lvol0 253:2 0 32M 0 lvm /mnt/x\x20y\x20z
(the mount path is mangled with \xNN that is visible in raw
lsblk output only and which is used in blkdeactive as well)
Before this patch:
[root@rhel6-a ~]# blkdeactivate -u
Deactivating block devices:
umount: /mnt/x\x20y\x20z: not found
After this patch applied:
[root@rhel6-a ~]# blkdeactivate -u
Deactivating block devices:
UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/x\x20y\x20z
LVM: deactivating Logical Volume vg/lvol0
---
WHATS_NEW | 1 +
scripts/blkdeactivate.sh.in | 30 ++++++++++++++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 11afee7..eb8a4a0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Fix blkdeactivate to handle nested mountpoints and mangled mount paths.
Set locales with LC_ALL instead of lower priority LANG variable.
Fix a crash-inducing race condition in lvmetad.
Add log/debug_classes to lvm.conf to control debug log messages.
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index 740bac5..849c61d 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -39,6 +39,7 @@ LVM="@sbindir@/lvm"
LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
LSBLK_VARS="local devtype local kname local name local mnt"
LSBLK_READ="read -r devtype kname name mnt"
+SORT_MNT="/bin/sort -r -k 4"
# Do not unmount mounted devices by default.
DO_UMOUNT=0
@@ -122,9 +123,11 @@ is_top_level_device() {
device_umount () {
test -z "$mnt" && return 0;
+ test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" && return 0
+
if test -z "${SKIP_UMOUNT_LIST["$mnt"]}" -a "$DO_UMOUNT" -eq "1"; then
echo " UMOUNT: unmounting $name ($kname) mounted on $mnt"
- $UMOUNT "$mnt" || add_device_to_skip_list
+ $UMOUNT "$(printf $mnt)" || add_device_to_skip_list
else
echo " [SKIP]: unmount of $name ($kname) mounted on $mnt"
add_device_to_skip_list
@@ -142,9 +145,6 @@ deactivate_holders () {
# check if the device not on the skip list already
test -z ${SKIP_DEVICE_LIST["$kname"]} || return 1
- # try to unmount it if mounted
- device_umount || return 1
-
# try to deactivate the holder
test $skip -eq 1 && skip=0 && continue
deactivate || return 1
@@ -226,7 +226,16 @@ deactivate_all() {
echo "Deactivating block devices:"
if test $# -eq 0; then
- # Deactivate all devices
+ #######################
+ # Process all devices #
+ #######################
+
+ # Unmount all relevant mountpoints first
+ while $LSBLK_READ; do
+ device_umount
+ done <<< "`$LSBLK | $SORT_MNT`"
+
+ # Do deactivate
while $LSBLK_READ; do
# 'disk' is at the bottom already and it's a real device
test "$devtype" = "disk" && continue
@@ -249,8 +258,17 @@ deactivate_all() {
deactivate || skip=1
done <<< "`$LSBLK -s`"
else
- # Deactivate only specified devices
+ ##################################
+ # Process only specified devices #
+ ##################################
+
while test $# -ne 0; do
+ # Unmount all relevant mountpoints first
+ while $LSBLK_READ; do
+ device_umount
+ done <<< "`$LSBLK $1 | $SORT_MNT`"
+
+ # Do deactivate
# Single dm device tree deactivation.
if test -b "$1"; then
$LSBLK_READ <<< "`$LSBLK --nodeps $1`"
10 years, 10 months
master - locales: use higher prio LC_ALL variable
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8bcc1da2f3f8e5...
Commit: 8bcc1da2f3f8e5f62af7b9e3a0967f7d1a60b582
Parent: 142c4bf9f04a46daf1c3d94581b43ec7c481ba59
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 22 11:25:02 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 22 11:25:02 2013 +0100
locales: use higher prio LC_ALL variable
For reseting locale environment into significantly less memory
consuming version 'C' - use LC_ALL instead of LANG since it has
higher priority in locale settings.
Otherwise we may observe whole locale-archive which might be
over 100MB on i.e. Fedora systems locked in memory with
some daemons.
---
WHATS_NEW | 1 +
daemons/clvmd/clvmd.c | 4 ++--
daemons/dmeventd/dmeventd.c | 4 ++--
libdaemon/server/daemon-server.c | 4 ++--
scripts/fsadm.sh | 14 +++++++-------
5 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 987cefa..11afee7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Set locales with LC_ALL instead of lower priority LANG variable.
Fix a crash-inducing race condition in lvmetad.
Add log/debug_classes to lvm.conf to control debug log messages.
Synchronize with udev in pvscan --cache and fix dangling udev_sync cookies.
diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 398e1a4..54cf1ac 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -440,8 +440,8 @@ int main(int argc, char *argv[])
* used by some glibc (on some distributions it takes over 100MB).
* Daemon currently needs to use mlockall().
*/
- if (setenv("LANG", "C", 1))
- perror("Cannot set LANG to C");
+ if (setenv("LC_ALL", "C", 1))
+ perror("Cannot set LC_ALL to C");
/* Setting debug options on an existing clvmd */
if (debug_opt && !check_local_clvmd()) {
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 5f2339f..55b940f 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1965,8 +1965,8 @@ int main(int argc, char *argv[])
* used by some glibc (on some distributions it takes over 100MB).
* Daemon currently needs to use mlockall().
*/
- if (setenv("LANG", "C", 1))
- perror("Cannot set LANG to C");
+ if (setenv("LC_ALL", "C", 1))
+ perror("Cannot set LC_ALL to C");
if (_restart)
restart();
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 0237465..735a0ea 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -456,8 +456,8 @@ void daemon_start(daemon_state s)
* some glibc (on some distributions it takes over 100MB). Some daemons
* need to use mlockall().
*/
- if (setenv("LANG", "C", 1))
- perror("Cannot set LANG to C");
+ if (setenv("LC_ALL", "C", 1))
+ perror("Cannot set LC_ALL to C");
#ifdef linux
_systemd_activation = _systemd_handover(&s);
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 4624a1c..1e8a22a 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -213,8 +213,8 @@ detect_mounted() {
# for systems with different device names - check also mount output
if test -z "$MOUNTED" ; then
- MOUNTED=$(LANG=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]")
- test -z "$MOUNTED" && MOUNTED=$(LANG=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]")
+ MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]")
+ test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]")
MOUNTED=${MOUNTED##* on }
MOUNTED=${MOUNTED% type *} # allow type in the mount name
fi
@@ -283,7 +283,7 @@ validate_parsing() {
####################################
resize_ext() {
verbose "Parsing $TUNE_EXT -l \"$VOLUME\""
- for i in $(LANG=C "$TUNE_EXT" -l "$VOLUME"); do
+ for i in $(LC_ALL=C "$TUNE_EXT" -l "$VOLUME"); do
case "$i" in
"Block size"*) BLOCKSIZE=${i##* } ;;
"Block count"*) BLOCKCOUNT=${i##* } ;;
@@ -318,7 +318,7 @@ resize_reiser() {
detect_mounted && verbose "ReiserFS resizes only unmounted filesystem" && try_umount
REMOUNT=$MOUNTED
verbose "Parsing $TUNE_REISER \"$VOLUME\""
- for i in $(LANG=C "$TUNE_REISER" "$VOLUME"); do
+ for i in $(LC_ALL=C "$TUNE_REISER" "$VOLUME"); do
case "$i" in
"Blocksize"*) BLOCKSIZE=${i##*: } ;;
"Count of blocks"*) BLOCKCOUNT=${i##*: } ;;
@@ -347,7 +347,7 @@ resize_xfs() {
temp_mount || error "Cannot mount Xfs filesystem"
fi
verbose "Parsing $TUNE_XFS \"$MOUNTPOINT\""
- for i in $(LANG=C "$TUNE_XFS" "$MOUNTPOINT"); do
+ for i in $(LC_ALL=C "$TUNE_XFS" "$MOUNTPOINT"); do
case "$i" in
"data"*) BLOCKSIZE=${i##*bsize=} ; BLOCKCOUNT=${i##*blocks=} ;;
esac
@@ -389,7 +389,7 @@ resize() {
####################################
# Calclulate diff between two dates
-# LANG=C input is expected the
+# LC_ALL=C input is expected the
# only one supported
####################################
diff_dates() {
@@ -410,7 +410,7 @@ check() {
"ext2"|"ext3"|"ext4")
IFS_CHECK=$IFS
IFS=$NL
- for i in $(LANG=C "$TUNE_EXT" -l "$VOLUME"); do
+ for i in $(LC_ALL=C "$TUNE_EXT" -l "$VOLUME"); do
case "$i" in
"Last mount"*) LASTMOUNT=${i##*: } ;;
"Last checked"*) LASTCHECKED=${i##*: } ;;
10 years, 10 months
master - Update WHATS_NEW.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=142c4bf9f04a46...
Commit: 142c4bf9f04a46daf1c3d94581b43ec7c481ba59
Parent: 1e4a9534f4c0a04300f07bdbcfb62ba18bc82523
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Jan 16 11:22:08 2013 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Jan 16 11:22:08 2013 +0100
Update WHATS_NEW.
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c801f44..987cefa 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Fix a crash-inducing race condition in lvmetad.
Add log/debug_classes to lvm.conf to control debug log messages.
Synchronize with udev in pvscan --cache and fix dangling udev_sync cookies.
Fix autoactivation to not autoactivate VG/LV on each change of the PVs used.
10 years, 10 months
master - lvmetad: Call _lvmetad_handle_reply in lvmetad_vg_lookup.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1e4a9534f4c0a0...
Commit: 1e4a9534f4c0a04300f07bdbcfb62ba18bc82523
Parent: 15fdd5c90dda7f00f691668c13d5401206d22021
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Jan 16 11:12:22 2013 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Jan 16 11:19:33 2013 +0100
lvmetad: Call _lvmetad_handle_reply in lvmetad_vg_lookup.
---
lib/cache/lvmetad.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 9b54174..e7f00ac 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -306,11 +306,12 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
{
struct volume_group *vg = NULL;
daemon_reply reply;
+ int found;
char uuid[64];
struct format_instance *fid;
struct format_instance_ctx fic;
struct dm_config_node *top;
- const char *name;
+ const char *name, *diag_name;
const char *fmt_name;
struct format_type *fmt;
struct dm_config_node *pvcn;
@@ -325,14 +326,16 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
return_NULL;
log_debug_lvmetad("Asking lvmetad for VG %s (%s)", uuid, vgname ? : "name unknown");
reply = _lvmetad_send("vg_lookup", "uuid = %s", uuid, NULL);
+ diag_name = uuid;
} else {
if (!vgname)
log_error(INTERNAL_ERROR "VG name required (VGID not available)");
log_debug_lvmetad("Asking lvmetad for VG %s", vgname);
reply = _lvmetad_send("vg_lookup", "name = %s", vgname, NULL);
+ diag_name = vgname;
}
- if (!reply.error && !strcmp(daemon_reply_str(reply, "response", ""), "OK")) {
+ if (_lvmetad_handle_reply(reply, "lookup VG", diag_name, &found) && found) {
if (!(top = dm_config_find_node(reply.cft->root, "metadata"))) {
log_error(INTERNAL_ERROR "metadata config node not found.");
10 years, 10 months
master - lvmetad: Fix a race in metadata update.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=15fdd5c90dda7f...
Commit: 15fdd5c90dda7f00f691668c13d5401206d22021
Parent: 6fc596ca90640817fd555942bd5b5d3b7404a177
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Jan 16 11:09:37 2013 +0100
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Jan 16 11:19:33 2013 +0100
lvmetad: Fix a race in metadata update.
The idea is to avoid a period when an existing VG is not mapped to either the
old or the new name. (Note that the brief "blackout" was present even if the
name did not actually change.) We instead allow a brief overlap of a VG existing
under both names, i.e. a query for a VG might succeed but before a lock is
acquired the VG disappears.
---
daemons/lvmetad/lvmetad-core.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index cbd6b09..a789bad 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -454,7 +454,8 @@ static response vg_lookup(lvmetad_state *s, request r)
DEBUGLOG(s, "vg_lookup: updated uuid = %s, name = %s", uuid, name);
- if (!uuid)
+ /* Check the name here. */
+ if (!uuid || !name)
return reply_unknown("VG not found");
cft = lock_vg(s, uuid);
@@ -682,16 +683,14 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgid
lock_vgid_to_metadata(s);
old = dm_hash_lookup(s->vgid_to_metadata, _vgid);
+ oldname = dm_hash_lookup(s->vgid_to_vgname, _vgid);
unlock_vgid_to_metadata(s);
lock_vg(s, _vgid);
seq = dm_config_find_int(metadata, "metadata/seqno", -1);
- if (old) {
+ if (old)
haveseq = dm_config_find_int(old->root, "metadata/seqno", -1);
- oldname = dm_hash_lookup(s->vgid_to_vgname, _vgid);
- assert(oldname);
- }
if (seq < 0)
goto out;
@@ -743,7 +742,7 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgid
if (haveseq >= 0 && haveseq < seq) {
INFO(s, "Updating metadata for %s at %d to %d", _vgid, haveseq, seq);
/* temporarily orphan all of our PVs */
- remove_metadata(s, vgid, 1);
+ update_pvid_to_vgid(s, old, "#orphan", 0);
}
lock_vgid_to_metadata(s);
@@ -753,14 +752,17 @@ static int update_metadata(lvmetad_state *s, const char *name, const char *_vgid
dm_hash_insert(s->vgid_to_metadata, vgid, cft) &&
dm_hash_insert(s->vgid_to_vgname, vgid, cfgname) &&
dm_hash_insert(s->vgname_to_vgid, name, (void*) vgid)) ? 1 : 0;
+
+ if (retval && oldname && strcmp(name, oldname))
+ dm_hash_remove(s->vgname_to_vgid, oldname);
+
unlock_vgid_to_metadata(s);
if (retval)
- /* FIXME: What should happen when update fails */
retval = update_pvid_to_vgid(s, cft, vgid, 1);
unlock_pvid_to_vgid(s);
-out:
+out: /* FIXME: We should probably abort() on partial failures. */
if (!retval && cft)
dm_config_destroy(cft);
unlock_vg(s, _vgid);
10 years, 10 months
master - dmeventd: close dmeventd FIFO FDs on exec (add FD_CLOEXEC).
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6fc596ca906408...
Commit: 6fc596ca90640817fd555942bd5b5d3b7404a177
Parent: 2b760a7fa7de3b1e3d2db182e5c6fb472b4fe9a1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Jan 15 14:59:54 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Jan 15 14:59:54 2013 +0100
dmeventd: close dmeventd FIFO FDs on exec (add FD_CLOEXEC).
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 37 ++++++++++++++++++++++++++++---------
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ce342cf..12ba71e 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.78 -
===================================
+ Close open dmeventd FIFO file descriptors on exec (FD_CLOEXEC).
Fix resource leak in error path of dmeventd's umount of thin volume.
Automatically deactivate failed preloaded dm tree node.
Add DM_DISABLE_UDEV environment variable to manage dev nodes by libdm only.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 13148c3..5f2339f 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1237,7 +1237,8 @@ static int _get_timeout(struct message_data *message_data)
/* Initialize a fifos structure with path names. */
static void _init_fifos(struct dm_event_fifos *fifos)
{
- memset(fifos, 0, sizeof(*fifos));
+ fifos->client = -1;
+ fifos->server = -1;
fifos->client_path = DM_EVENT_FIFO_CLIENT;
fifos->server_path = DM_EVENT_FIFO_SERVER;
@@ -1254,7 +1255,7 @@ static int _open_fifos(struct dm_event_fifos *fifos)
syslog(LOG_ERR, "%s: Failed to create client fifo %s: %m.\n",
__func__, fifos->client_path);
(void) dm_prepare_selinux_context(NULL, 0);
- return 0;
+ goto fail;
}
/* Create server fifo. */
@@ -1263,7 +1264,7 @@ static int _open_fifos(struct dm_event_fifos *fifos)
syslog(LOG_ERR, "%s: Failed to create server fifo %s: %m.\n",
__func__, fifos->server_path);
(void) dm_prepare_selinux_context(NULL, 0);
- return 0;
+ goto fail;
}
(void) dm_prepare_selinux_context(NULL, 0);
@@ -1281,31 +1282,49 @@ static int _open_fifos(struct dm_event_fifos *fifos)
if (chmod(fifos->client_path, 0600)) {
syslog(LOG_ERR, "Unable to set correct file permissions on %s: %m.\n",
fifos->client_path);
- return 0;
+ goto fail;
}
if (chmod(fifos->server_path, 0600)) {
syslog(LOG_ERR, "Unable to set correct file permissions on %s: %m.\n",
fifos->server_path);
- return 0;
+ goto fail;
}
/* Need to open read+write or we will block or fail */
if ((fifos->server = open(fifos->server_path, O_RDWR)) < 0) {
syslog(LOG_ERR, "Failed to open fifo server %s: %m.\n",
fifos->server_path);
- return 0;
+ goto fail;
+ }
+
+ if (fcntl(fifos->server, F_SETFD, FD_CLOEXEC) < 0) {
+ syslog(LOG_ERR, "Failed to set FD_CLOEXEC for fifo server %s: %m.\n",
+ fifos->server_path);
+ goto fail;
}
/* Need to open read+write for select() to work. */
if ((fifos->client = open(fifos->client_path, O_RDWR)) < 0) {
syslog(LOG_ERR, "Failed to open fifo client %s: %m", fifos->client_path);
- if (close(fifos->server))
- syslog(LOG_ERR, "Failed to close fifo server %s: %m", fifos->server_path);
- return 0;
+ goto fail;
+ }
+
+ if (fcntl(fifos->client, F_SETFD, FD_CLOEXEC) < 0) {
+ syslog(LOG_ERR, "Failed to set FD_CLOEXEC for fifo client %s: %m.\n",
+ fifos->client_path);
+ goto fail;
}
return 1;
+fail:
+ if (fifos->server >= 0 && close(fifos->server))
+ syslog(LOG_ERR, "Failed to close fifo server %s: %m", fifos->server_path);
+
+ if (fifos->client >= 0 && close(fifos->client))
+ syslog(LOG_ERR, "Failed to close fifo client %s: %m", fifos->client_path);
+
+ return 0;
}
/*
10 years, 10 months
master - whatsnew
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2b760a7fa7de3b...
Commit: 2b760a7fa7de3b1e3d2db182e5c6fb472b4fe9a1
Parent: 9602e68577b43cf2090e680d7b4d2318c72009a7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 11 09:26:51 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 11 09:26:51 2013 +0100
whatsnew
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d7e8c7d..c801f44 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -32,6 +32,7 @@ Version 2.02.99 -
Do not verify udev operations if --noudevsync command option is used.
Fix lvm2app and return lvseg discards property as string.
Allow forced vgcfgrestore of lvm2 metadata with thin volumes.
+ Recognise Storage Class Memory (IBM S/390) devices in filter.
Recognise STEC skd devices in filter.
Recognise Violin Memory vtms devices in filter.
Add lvm.conf thin pool defs thin_pool_{chunk_size|discards|zero}.
10 years, 10 months
master - filters: add scm devices
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9602e68577b43c...
Commit: 9602e68577b43cf2090e680d7b4d2318c72009a7
Parent: 06abb2dd4c78e66529e7e6407db1afb3f0f44d85
Author: Sebastian Ott <sebott(a)linux.vnet.ibm.com>
AuthorDate: Thu Jan 10 20:20:37 2013 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 11 09:24:07 2013 +0100
filters: add scm devices
Fix this:
pvcreate /dev/scma
Device /dev/scma not found (or ignored by filtering).
Reported-by: Peter Oberparleiter <peter.oberparleiter(a)de.ibm.com>
Signed-off-by: Sebastian Ott <sebott(a)linux.vnet.ibm.com>
---
lib/filters/device-types.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/filters/device-types.h b/lib/filters/device-types.h
index aec4293..2e49f7f 100644
--- a/lib/filters/device-types.h
+++ b/lib/filters/device-types.h
@@ -58,5 +58,6 @@ static const device_info_t _device_info[] = {
{"mtip32xx", 16}, /* Micron PCIe SSDs */
{"vtms", 16}, /* Violin Memory */
{"skd", 16}, /* STEC */
+ {"scm", 8}, /* Storage Class Memory (IBM S/390) */
{"", 0}
};
10 years, 10 months