master - thin: online metadata resize requires 1.10
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=22d9daff12b73e...
Commit: 22d9daff12b73e72f520ea70f416e1d3057ae740
Parent: 899a079c8f36decd2fda42412091df57ab8f72cb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jan 21 13:48:57 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jan 21 13:50:17 2014 +0100
thin: online metadata resize requires 1.10
Version 1.10 starts to look promissing, let's enable
online resize when this thin-pool kernel target is present.
---
WHATS_NEW | 1 +
lib/thin/thin.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 982f44d..a5e58b5 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Online thin pool metadata resize requires 1.10 kernel thin pool target.
Version 2.02.105 - 20th January 2014
====================================
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index ff263d9..6011d77 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -618,7 +618,7 @@ static int _thin_target_present(struct cmd_context *cmd,
{ 1, 1, THIN_FEATURE_EXTERNAL_ORIGIN, "external_origin" },
{ 1, 4, THIN_FEATURE_BLOCK_SIZE, "block_size" },
{ 1, 5, THIN_FEATURE_DISCARDS_NON_POWER_2, "discards_non_power_2" },
- { 9, 9, THIN_FEATURE_METADATA_RESIZE, "metadata_resize" },
+ { 1, 10, THIN_FEATURE_METADATA_RESIZE, "metadata_resize" },
};
static const char _lvmconf[] = "global/thin_disabled_features";
10 years, 2 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=899a079c8f36de...
Commit: 899a079c8f36decd2fda42412091df57ab8f72cb
Parent: aa21e79991da6f6583f708f81ff32a1e2c0c3a42
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Jan 20 19:41:30 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Jan 20 19:41:30 2014 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 07b56f1..13e0ce8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.105(2)-git (2014-01-20)
+2.02.106(2)-git (2014-01-20)
diff --git a/VERSION_DM b/VERSION_DM
index 23b8f70..5c743b5 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.84-git (2014-01-20)
+1.02.85-git (2014-01-20)
diff --git a/WHATS_NEW b/WHATS_NEW
index 26b63ae..982f44d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.106 -
+====================================
+
Version 2.02.105 - 20th January 2014
====================================
Fix thin LV flagging for udev to skip scanning only if the LV is wiped.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ce302f3..448a7f0 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.85 -
+===================================
+
Version 1.02.84 - 20th January 2014
===================================
Revert activation of activated nodes if a node preload callback fails.
10 years, 3 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aa21e79991da6f...
Commit: aa21e79991da6f6583f708f81ff32a1e2c0c3a42
Parent: cf97d8d5f9449a2102f3e6c92efe4987744c96e9
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Jan 20 19:22:56 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Jan 20 19:22:56 2014 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 28 +++++++++++++++++-----------
WHATS_NEW_DM | 8 ++++----
lib/metadata/pv.c | 33 ++++++++++++++++++++++++---------
lib/report/report.c | 1 -
6 files changed, 47 insertions(+), 27 deletions(-)
diff --git a/VERSION b/VERSION
index 8594917..07b56f1 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.105(2)-git (2013-11-13)
+2.02.105(2)-git (2014-01-20)
diff --git a/VERSION_DM b/VERSION_DM
index d36b815..23b8f70 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.84-git (2013-11-13)
+1.02.84-git (2014-01-20)
diff --git a/WHATS_NEW b/WHATS_NEW
index 284c92e..26b63ae 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,7 +1,7 @@
-Version 2.02.105 -
-=====================================
- Fix thin LV flagging for udev to skip scanning only if the LV is wiped
- Replace use of xfs_check with xfs_reparir in fsadm.
+Version 2.02.105 - 20th January 2014
+====================================
+ Fix thin LV flagging for udev to skip scanning only if the LV is wiped.
+ Replace use of xfs_check with xfs_repair in fsadm.
Mark lvm1 format metadata as FMT_OBSOLETE. Do not use it with lvmetad.
Invalidate cached VG struct after a PV in it gets orphaned. (2.02.87)
Mark pool format metadata as FMT_OBSOLETE.
@@ -12,7 +12,7 @@ Version 2.02.105 -
Optimize double call of stat() for cached devices.
Enable support for thin provisioning for default configuration.
Improve process_each_lv_in_vg() tag processing.
- Reodered and simplified logging code.
+ Reordered and simplified logging code.
Fix SYSTEMD_READY assignment for foreign devices in lvmetad udev rules.
Disable online thin pool metadata resize for 1.9 kernel thin target.
Shortened code for initialization of raid segment types.
@@ -49,13 +49,19 @@ Version 2.02.105 -
Check for failure of dev_get_size() when reporting device size.
Drop extra unneeded '/' when scanning sysfs directory.
Fix undef value if skipped clustered VG ignored for toollib PV seg. (2.02.103)
- liblvm/python API Add ability to validate VG/LV names.
- liblvm/python API Add ability to create PV with arguments.
- liblvm/python API Fail VG reduce when insufficient metadata copies
- Fix install of conf subdir when not building in srcdir.
+ Support validation of VG/LV names in liblvm/python.
+ Allow creation of PVs with arguments to liblvm/python.
+ Ensure sufficient metadata copies retained in liblvm/python vgreduce.
+ Fix installation of profiles from conf subdir when not building in srcdir.
+ Show UUIDs for missing PVs in reports.
+ Change dev_size/name, pv_fmt/mda_free/mda_size/uuid fields from pv to label.
+ Add struct device *dev to struct label.
+ Introduce process_each_label.
+ Change void *private to struct format_type *fmt in struct labeller.
+ Remove pv_read.
Add reporting of thin_id device id for thin volumes.
- Fix reporting of empty numerical values.
- Simplify reporting code.
+ Fix reporting of empty numerical values for recently-added fields.
+ Use _field_set_percent/value in reporting code.
Version 2.02.104 - 13th November 2013
=====================================
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index af82096..ce302f3 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,8 +1,8 @@
-Version 1.02.84 -
-====================================
- Deactive already actived nodes when node's preload callback fails.
+Version 1.02.84 - 20th January 2014
+===================================
+ Revert activation of activated nodes if a node preload callback fails.
Avoid busy looping on CPU when dmeventd reads event DM_WAIT_RETRY.
- Ensure global mutex is being hold when working with dmeventd thread.
+ Ensure global mutex is held when working with dmeventd thread.
Drop taking timeout mutex for un/registering dmeventd monitor.
Allow section names in config file data to be quoted strings.
Close fifos before exiting in dmeventd restart() error path.
diff --git a/lib/metadata/pv.c b/lib/metadata/pv.c
index 6f5fca4..45acef4 100644
--- a/lib/metadata/pv.c
+++ b/lib/metadata/pv.c
@@ -88,6 +88,7 @@ uint64_t pv_dev_size(const struct physical_volume *pv)
if (!dev_get_size(pv->dev, &size))
size = 0;
+
return size;
}
@@ -99,6 +100,7 @@ uint64_t pv_size_field(const struct physical_volume *pv)
size = pv->size;
else
size = (uint64_t) pv->pe_count * pv->pe_size;
+
return size;
}
@@ -111,6 +113,7 @@ uint64_t pv_free(const struct physical_volume *pv)
else
freespace = (uint64_t)
(pv->pe_count - pv->pe_alloc_count) * pv->pe_size;
+
return freespace;
}
@@ -154,14 +157,17 @@ uint32_t pv_mda_count(const struct physical_volume *pv)
struct lvmcache_info *info;
info = lvmcache_info_from_pvid((const char *)&pv->id.uuid, 0);
+
return info ? lvmcache_mda_count(info) : UINT64_C(0);
}
static int _count_unignored(struct metadata_area *mda, void *baton)
{
uint32_t *count = baton;
+
if (!mda_is_ignored(mda))
(*count) ++;
+
return 1;
}
@@ -174,6 +180,7 @@ uint32_t pv_mda_used_count(const struct physical_volume *pv)
if (!info)
return 0;
lvmcache_foreach_mda(info, _count_unignored, &used_count);
+
return used_count;
}
@@ -228,7 +235,8 @@ uint64_t pv_mda_size(const struct physical_volume *pv)
return min_mda_size;
}
-static int _pv_mda_free(struct metadata_area *mda, void *baton) {
+static int _pv_mda_free(struct metadata_area *mda, void *baton)
+{
uint64_t mda_free;
uint64_t *freespace = baton;
@@ -238,6 +246,7 @@ static int _pv_mda_free(struct metadata_area *mda, void *baton) {
mda_free = mda->ops->mda_free_sectors(mda);
if (mda_free < *freespace)
*freespace = mda_free;
+
return 1;
}
@@ -258,8 +267,10 @@ uint64_t pv_mda_free(const struct physical_volume *pv)
{
const char *pvid = (const char *)&pv->id.uuid;
struct lvmcache_info *info;
+
if ((info = lvmcache_info_from_pvid(pvid, 0)))
return lvmcache_info_mda_free(info);
+
return 0;
}
@@ -271,6 +282,7 @@ uint64_t pv_used(const struct physical_volume *pv)
used = 0LL;
else
used = (uint64_t) pv->pe_alloc_count * pv->pe_size;
+
return used;
}
@@ -299,6 +311,7 @@ static int _pv_mda_set_ignored_one(struct metadata_area *mda, void *baton)
mda_set_ignored(vg_mda, b->mda_ignored);
mda_set_ignored(mda, b->mda_ignored);
+
return 1;
}
@@ -355,12 +368,14 @@ struct label *pv_label(const struct physical_volume *pv)
{
struct lvmcache_info *info =
lvmcache_info_from_pvid((const char *)&pv->id.uuid, 0);
- if (!info) {
- if (pv->vg && pv->dev) /* process_each_pv will create PVs that are dummy
- * and that have no label associated */
- log_error(INTERNAL_ERROR "PV %s unexpectedly not in cache.",
- dev_name(pv->dev));
- return NULL;
- }
- return lvmcache_get_label(info);
+
+ if (info)
+ return lvmcache_get_label(info);
+
+ /* process_each_pv() may create dummy PVs that have no label */
+ if (pv->vg && pv->dev)
+ log_error(INTERNAL_ERROR "PV %s unexpectedly not in cache.",
+ dev_name(pv->dev));
+
+ return NULL;
}
diff --git a/lib/report/report.c b/lib/report/report.c
index bd4b725..3a5119d 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -55,7 +55,6 @@ static int _field_set_percent(struct dm_report_field *field,
uint64_t *sortval;
if (percent == PERCENT_INVALID)
- // FIXME maybe use here '--'?
return _field_set_value(field, "", &_minusone64);
if (!(repstr = dm_pool_alloc(mem, 8)) ||
10 years, 3 months
master - udev: clear temporary variable properly
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cf97d8d5f9449a...
Commit: cf97d8d5f9449a2102f3e6c92efe4987744c96e9
Parent: 91b26b63b408b7d7b4f79f0754d190783874e4cc
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 20 12:54:10 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 20 12:54:10 2014 +0100
udev: clear temporary variable properly
Clear temporary DM_DISABLE_OTHER_RULES_FLAG properly. This did not
cause any bug or problem as the temporary variable is overwritten next
time it's used again, but we should still clean it properly!
---
udev/11-dm-lvm.rules.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/udev/11-dm-lvm.rules.in b/udev/11-dm-lvm.rules.in
index 9ca0375..91cb991 100644
--- a/udev/11-dm-lvm.rules.in
+++ b/udev/11-dm-lvm.rules.in
@@ -33,7 +33,7 @@ IMPORT{program}="(DM_EXEC)/dmsetup splitname --nameprefixes --noheadings --rows
ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_NOSCAN}="1", ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", IMPORT{db}="DM_NOSCAN", IMPORT{db}="DM_DISABLE_OTHER_RULES_FLAG_OLD"
ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}", \
- ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG_OLD}="", ENV{DM_NOSCAN}=""
+ ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="", ENV{DM_NOSCAN}=""
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end"
10 years, 3 months
master - thin: fix thin LV flagging for udev to skip scanning
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=91b26b63b408b7...
Commit: 91b26b63b408b7d7b4f79f0754d190783874e4cc
Parent: 79768b2e9c01f6a56d6e2fef7d3bd82f9ce3c2c1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Jan 20 12:38:21 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jan 20 12:38:21 2014 +0100
thin: fix thin LV flagging for udev to skip scanning
Only flag thin LV for no scanning in udev if this LV is about
to be wiped. This happens only in case the thin LV's pool was not
created with zeroing of the new blocks enabled.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 18 ++++++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6f7abe6..284c92e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ Fix thin LV flagging for udev to skip scanning only if the LV is wiped
Replace use of xfs_check with xfs_reparir in fsadm.
Mark lvm1 format metadata as FMT_OBSOLETE. Do not use it with lvmetad.
Invalidate cached VG struct after a PV in it gets orphaned. (2.02.87)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 62ca245..f45c89f 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5634,6 +5634,18 @@ out:
return 1;
}
+static int _should_wipe_lv(struct lvcreate_params *lp, struct logical_volume *lv) {
+ int r = lp->zero | lp->wipe_signatures;
+
+ if (!seg_is_thin(lp))
+ return r;
+
+ if (lv_is_thin_volume(lv))
+ return r && !lp->snapshot && !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks;
+
+ return 0;
+}
+
/* Thin notes:
* If lp->thin OR lp->activate is AY*, activate the pool if not already active.
* If lp->thin, create thin LV within the pool - as a snapshot if lp->snapshot.
@@ -6029,7 +6041,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
/* Do not scan this LV until properly zeroed/wiped. */
- if (lp->zero | lp->wipe_signatures)
+ if (_should_wipe_lv(lp, lv))
lv->status |= LV_NOSCAN;
if (lp->temporary)
@@ -6110,9 +6122,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
log_verbose("Signature wiping on \"%s/%s\" not requested", lv->vg->name, lv->name);
}
- if ((!seg_is_thin(lp) ||
- (lv_is_thin_volume(lv) && !lp->snapshot &&
- !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks))) {
+ if (_should_wipe_lv(lp, lv)) {
if (!wipe_lv(lv, (struct wipe_params)
{
.do_zero = lp->zero,
10 years, 3 months
master - tests: update testing for xfs
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79768b2e9c01f6...
Commit: 79768b2e9c01f6a56d6e2fef7d3bd82f9ce3c2c1
Parent: 59336a2a0626eba91dc3bc76ff6297e0c70e7e9e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 12:02:33 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 12:02:33 2014 +0100
tests: update testing for xfs
---
WHATS_NEW | 1 +
test/shell/fsadm.sh | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 834cf0f..6f7abe6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
+ Replace use of xfs_check with xfs_reparir in fsadm.
Mark lvm1 format metadata as FMT_OBSOLETE. Do not use it with lvmetad.
Invalidate cached VG struct after a PV in it gets orphaned. (2.02.87)
Mark pool format metadata as FMT_OBSOLETE.
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 4e624db..8d4b37d 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2008-2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -24,7 +24,9 @@ check_reiserfs=
which mkfs.ext3 || check_ext3=${check_ext3:-mkfs.ext3}
which fsck.ext3 || check_ext3=${check_ext3:-fsck.ext3}
which mkfs.xfs || check_xfs=${check_xfs:-mkfs.xfs}
-which xfs_check || check_xfs=${check_xfs:-xfs_check}
+which xfs_check || {
+ which xfs_repair || check_xfs=${check_xfs:-xfs_repair}
+}
which mkfs.reiserfs || check_reiserfs=${check_reiserfs:-mkfs.reiserfs}
which reiserfsck || check_reiserfs=${check_reiserfs:-reiserfsck}
@@ -54,7 +56,11 @@ fscheck_ext3()
fscheck_xfs()
{
- xfs_check "$dev_vg_lv"
+ if which xfs_repair ; then
+ xfs_repair -n "$dev_vg_lv"
+ else
+ xfs_check "$dev_vg_lv"
+ fi
}
fscheck_reiserfs()
@@ -67,8 +73,9 @@ check_missing()
eval local t=$\check_$1
test -z "$t" && return 0
test "$t" = skip && return 1
- # trick for warning test
- echo "WARNING: fsadm test skipped $1 tests, $t tool is missing"
+ # trick to get test listed with warning
+ echo "WARNING: fsadm test skipped $1 tests, $t tool is missing."
+ should false;
return 1
}
10 years, 3 months
master - fsadm: use xfs_repair when available
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=59336a2a0626eb...
Commit: 59336a2a0626eba91dc3bc76ff6297e0c70e7e9e
Parent: 5f9035363684953d66c076f0f874d12d0576b4b2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 11:57:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 11:57:39 2014 +0100
fsadm: use xfs_repair when available
Since support for xfs_check is going to be obsoleted,
replace its usage with xfs_repair -n tool.
However this tool needs further intrumentation, since for really small
xfs devices (having just 1 allocation group) it needs to pass in
flag: "-o force_geometry". As we run the tool with '-n', it should
be safe to pass this flag always.
FIXME: figure way without always passing this flag.
---
scripts/fsadm.sh | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 1e8a22a..e6fe7ce 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -54,6 +54,8 @@ READLINK=readlink
READLINK_E="-e"
FSCK=fsck
XFS_CHECK=xfs_check
+# XFS_REPAIR -n is used when XFS_CHECK is not found
+XFS_REPAIR=xfs_repair
# user may override lvm location by setting LVM_BINARY
LVM=${LVM_BINARY:-lvm}
@@ -430,7 +432,15 @@ check() {
esac
case "$FSTYPE" in
- "xfs") dry "$XFS_CHECK" "$VOLUME" ;;
+ "xfs") if which "$XFS_CHECK" >"$NULL" 2>&1 ; then
+ dry "$XFS_CHECK" "$VOLUME"
+ else
+ # Replacement for outdated xfs_check
+ # FIXME: for small devices we need to force_geometry,
+ # since we run in '-n' mode, it shouldn't be problem.
+ # Think about better way....
+ dry "$XFS_REPAIR" -n -o force_geometry "$VOLUME"
+ fi ;;
*) # check if executed from interactive shell environment
case "$-" in
*i*) dry "$FSCK" $YES $FORCE "$VOLUME" ;;
@@ -452,7 +462,8 @@ test -n "$FSADM_RUNNING" && exit 0
test -n "$TUNE_EXT" -a -n "$RESIZE_EXT" -a -n "$TUNE_REISER" -a -n "$RESIZE_REISER" \
-a -n "$TUNE_XFS" -a -n "$RESIZE_XFS" -a -n "$MOUNT" -a -n "$UMOUNT" -a -n "$MKDIR" \
-a -n "$RMDIR" -a -n "$BLOCKDEV" -a -n "$BLKID" -a -n "$GREP" -a -n "$READLINK" \
- -a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "$LVM" \
+ -a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "$XFS_REPAIR" \
+ -a -n "$LVM" \
|| error "Required command definitions in the script are missing!"
"$LVM" version >"$NULL" 2>&1 || error "Could not run lvm binary \"$LVM\""
10 years, 3 months
master - libdm: WHATSNEW
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5f903536368495...
Commit: 5f9035363684953d66c076f0f874d12d0576b4b2
Parent: 0638d1d82e349c332ea2e7e6be96f4b1f4fc5c2e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 17 11:02:29 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 17 11:02:29 2014 +0100
libdm: WHATSNEW
---
WHATS_NEW_DM | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index effd0cc..af82096 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.84 -
====================================
+ Deactive already actived nodes when node's preload callback fails.
Avoid busy looping on CPU when dmeventd reads event DM_WAIT_RETRY.
Ensure global mutex is being hold when working with dmeventd thread.
Drop taking timeout mutex for un/registering dmeventd monitor.
10 years, 3 months
master - libdm: preload revert after failing callback
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0638d1d82e349c...
Commit: 0638d1d82e349c332ea2e7e6be96f4b1f4fc5c2e
Parent: d98511c717d64f111208e647e861620e310118d6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 15 12:42:47 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 17 10:48:49 2014 +0100
libdm: preload revert after failing callback
Revert activated volumes if callback fails.
This is currently used only for thin_check failure support.
When thin_check detects failure in thin metadata device, it deactivate
volumes in reversed order that have been preloaded for thin pool activation.
After this change lvm command will not leave active pool subvolumes
in dm table.
---
libdm/libdm-deptree.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index db88d9d..42bb9e7 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -271,6 +271,17 @@ struct dm_tree_node {
/* Callback */
dm_node_callback_fn callback;
void *callback_data;
+
+ /*
+ * TODO:
+ * Add advanced code which tracks of send ioctls and their
+ * proper revert operation for more advanced recovery
+ * Current code serves mostly only to recovery when
+ * thin pool metadata check fails and command would
+ * have left active thin data and metadata subvolumes.
+ */
+ struct dm_list activated; /* Head of activated nodes for preload revert */
+ struct dm_list activated_list; /* List of activated nodes for preload revert */
};
struct dm_tree {
@@ -303,6 +314,7 @@ struct dm_tree *dm_tree_create(void)
dtree->root.dtree = dtree;
dm_list_init(&dtree->root.uses);
dm_list_init(&dtree->root.used_by);
+ dm_list_init(&dtree->root.activated);
dtree->skip_lockfs = 0;
dtree->no_flush = 0;
dtree->mem = dmem;
@@ -488,6 +500,7 @@ static struct dm_tree_node *_create_dm_tree_node(struct dm_tree *dtree,
dm_list_init(&node->uses);
dm_list_init(&node->used_by);
+ dm_list_init(&node->activated);
dm_list_init(&node->props.segs);
dev = MKDEV((dev_t)info->major, info->minor);
@@ -2537,6 +2550,25 @@ out:
return r;
}
+static int _dm_tree_revert_activated(struct dm_tree_node *parent)
+{
+ struct dm_tree_node *child;
+
+ dm_list_iterate_back_items_gen(child, &parent->activated, activated_list) {
+ _dm_tree_revert_activated(child);
+ log_debug("Reverting preloaded %s.", child->name);
+ if (!_deactivate_node(child->name, child->info.major, child->info.minor,
+ &child->dtree->cookie, child->udev_flags, 0)) {
+ log_error("Unable to deactivate %s (%" PRIu32
+ ":%" PRIu32 ")", child->name, child->info.major,
+ child->info.minor);
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
int dm_tree_preload_children(struct dm_tree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len)
@@ -2601,6 +2633,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
continue;
}
+ if (!child->info.live_table)
+ /* Collect newly introduced devices for revert */
+ dm_list_add(&dnode->activated, &child->activated_list);
+
/* Update cached info */
child->info = newinfo;
/*
@@ -2621,7 +2657,11 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
if (!dnode->info.exists && dnode->callback &&
!dnode->callback(dnode, DM_NODE_CALLBACK_PRELOADED,
dnode->callback_data))
+ {
+ /* Try to deactivate what has been activated in preload phase */
+ (void) _dm_tree_revert_activated(dnode);
return_0;
+ }
}
return r;
10 years, 3 months
master - cleanup: indent
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d98511c717d64f...
Commit: d98511c717d64f111208e647e861620e310118d6
Parent: 5eee73bd7cb8e4712ad5e5d13a3bffb78e02c9ca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 8 16:51:11 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 17 10:48:49 2014 +0100
cleanup: indent
---
libdm/libdm-deptree.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 7bc1f33..db88d9d 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1620,8 +1620,8 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode,
}
int dm_tree_deactivate_children(struct dm_tree_node *dnode,
- const char *uuid_prefix,
- size_t uuid_prefix_len)
+ const char *uuid_prefix,
+ size_t uuid_prefix_len)
{
return _dm_tree_deactivate_children(dnode, uuid_prefix, uuid_prefix_len, 0);
}
10 years, 3 months