Hello community, here is the log from the commit of package lvm2 checked in at Wed Aug 16 14:33:43 CEST 2006. -------- --- lvm2/lvm2.changes 2006-07-28 15:22:21.000000000 +0200 +++ lvm2/lvm2.changes 2006-08-16 11:31:05.000000000 +0200 @@ -1,0 +2,11 @@ +Wed Aug 16 11:16:13 CEST 2006 - fehr@suse.de + +- update to new version 2.02.08 + Add checks for duplicate LV name, lvid and PV id before writing metadata. + Report all sanity check failures, not just the first. + Fix missing lockfs on first snapshot creation. (#197850) + Add unreliable --trustcache option to reporting commands. + Fix locking for mimage removal. + Fix clvmd_init_rhel4 'status' exit code. + +------------------------------------------------------------------- Old: ---- LVM2.2.02.07.tar.bz2 New: ---- LVM2.2.02.08.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lvm2.spec ++++++ --- /var/tmp/diff_new_pack.o0YT1U/_old 2006-08-16 14:33:34.000000000 +0200 +++ /var/tmp/diff_new_pack.o0YT1U/_new 2006-08-16 14:33:34.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package lvm2 (Version 2.02.07) +# spec file for package lvm2 (Version 2.02.08) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -20,7 +20,7 @@ PreReq: %fillup_prereq %insserv_prereq %endif Autoreqprov: on -Version: 2.02.07 +Version: 2.02.08 Release: 1 Summary: LVM2 Tools Source: LVM2.%{version}.tar.bz2 @@ -175,6 +175,14 @@ %{_mandir}/man8/vgsplit.8.gz %changelog -n lvm2 +* Wed Aug 16 2006 - fehr@suse.de +- update to new version 2.02.08 + Add checks for duplicate LV name, lvid and PV id before writing metadata. + Report all sanity check failures, not just the first. + Fix missing lockfs on first snapshot creation. (#197850) + Add unreliable --trustcache option to reporting commands. + Fix locking for mimage removal. + Fix clvmd_init_rhel4 'status' exit code. * Fri Jul 28 2006 - olh@suse.de - remove dropped boot.ibmsis from boot.lvm - boot.rootfsck should start before boot.lvm (#181972) ++++++ LVM2.2.02.07.tar.bz2 -> LVM2.2.02.08.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/VERSION new/LVM2.2.02.08/VERSION --- old/LVM2.2.02.07/VERSION 2006-07-17 16:32:45.000000000 +0200 +++ new/LVM2.2.02.08/VERSION 2006-08-15 21:07:03.000000000 +0200 @@ -1 +1 @@ -2.02.07 (2006-07-17) +2.02.08 (2006-08-15) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/WHATS_NEW new/LVM2.2.02.08/WHATS_NEW --- old/LVM2.2.02.07/WHATS_NEW 2006-07-17 16:32:00.000000000 +0200 +++ new/LVM2.2.02.08/WHATS_NEW 2006-08-15 21:06:09.000000000 +0200 @@ -1,3 +1,12 @@ +Version 2.02.08 - 15th August 2006 +================================== + Add checks for duplicate LV name, lvid and PV id before writing metadata. + Report all sanity check failures, not just the first. + Fix missing lockfs on first snapshot creation. + Add unreliable --trustcache option to reporting commands. + Fix locking for mimage removal. + Fix clvmd_init_rhel4 'status' exit code. + Version 2.02.07 - 17th July 2006 ================================ Fix activation logic in lvchange --persistent. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/activate/activate.c new/LVM2.2.02.08/lib/activate/activate.c --- old/LVM2.2.02.07/lib/activate/activate.c 2006-05-25 15:32:26.000000000 +0200 +++ new/LVM2.2.02.08/lib/activate/activate.c 2006-08-08 23:20:00.000000000 +0200 @@ -528,7 +528,7 @@ return r; } -static int _lv_suspend_lv(struct logical_volume *lv) +static int _lv_suspend_lv(struct logical_volume *lv, int lockfs) { int r; struct dev_manager *dm; @@ -536,7 +536,7 @@ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name))) return_0; - if (!(r = dev_manager_suspend(dm, lv))) + if (!(r = dev_manager_suspend(dm, lv, lockfs))) stack; dev_manager_destroy(dm); @@ -637,6 +637,7 @@ { struct logical_volume *lv, *lv_pre; struct lvinfo info; + int lockfs = 0; if (!activation()) return 1; @@ -672,7 +673,11 @@ stack; memlock_inc(); - if (!_lv_suspend_lv(lv)) { + + if (lv_is_origin(lv_pre) || lv_is_cow(lv_pre)) + lockfs = 1; + + if (!_lv_suspend_lv(lv, lockfs)) { memlock_dec(); fs_unlock(); return 0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/activate/dev_manager.c new/LVM2.2.02.08/lib/activate/dev_manager.c --- old/LVM2.2.02.07/lib/activate/dev_manager.c 2006-07-10 21:17:40.000000000 +0200 +++ new/LVM2.2.02.08/lib/activate/dev_manager.c 2006-08-08 23:20:00.000000000 +0200 @@ -37,6 +37,7 @@ ACTIVATE, DEACTIVATE, SUSPEND, + SUSPEND_WITH_LOCKFS, CLEAN } action_t; @@ -984,8 +985,8 @@ goto_out; break; case SUSPEND: - if (!lv_is_origin(lv) && !lv_is_cow(lv)) - dm_tree_skip_lockfs(root); + dm_tree_skip_lockfs(root); + case SUSPEND_WITH_LOCKFS: if (!dm_tree_suspend_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1)) goto_out; break; @@ -1049,9 +1050,10 @@ return r; } -int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv) +int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv, + int lockfs) { - return _tree_action(dm, lv, SUSPEND); + return _tree_action(dm, lv, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND); } /* diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/activate/dev_manager.h new/LVM2.2.02.08/lib/activate/dev_manager.h --- old/LVM2.2.02.07/lib/activate/dev_manager.h 2006-05-16 18:48:30.000000000 +0200 +++ new/LVM2.2.02.08/lib/activate/dev_manager.h 2006-08-08 23:20:00.000000000 +0200 @@ -47,7 +47,8 @@ int dev_manager_mirror_percent(struct dev_manager *dm, struct logical_volume *lv, int wait, float *percent, uint32_t *event_nr); -int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv); +int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv, + int lockfs); int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv); int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv); int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/cache/lvmcache.c new/LVM2.2.02.08/lib/cache/lvmcache.c --- old/LVM2.2.02.07/lib/cache/lvmcache.c 2006-06-14 22:11:22.000000000 +0200 +++ new/LVM2.2.02.08/lib/cache/lvmcache.c 2006-08-01 16:56:32.000000000 +0200 @@ -241,7 +241,7 @@ goto out; } - if (!(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1: 0))) { + if (!(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1 : 0))) { log_error("dev_iter creation failed"); goto out; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/device/dev-cache.c new/LVM2.2.02.08/lib/device/dev-cache.c --- old/LVM2.2.02.07/lib/device/dev-cache.c 2006-04-19 17:33:06.000000000 +0200 +++ new/LVM2.2.02.08/lib/device/dev-cache.c 2006-08-01 16:56:32.000000000 +0200 @@ -645,8 +645,7 @@ return NULL; } - - if (dev_scan) { + if (dev_scan && !trust_cache()) { /* Flag gets reset between each command */ if (!full_scan_done()) persistent_filter_wipe(f); /* Calls _full_scan(1) */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/format1/disk-rep.c new/LVM2.2.02.08/lib/format1/disk-rep.c --- old/LVM2.2.02.07/lib/format1/disk-rep.c 2006-05-11 20:39:24.000000000 +0200 +++ new/LVM2.2.02.08/lib/format1/disk-rep.c 2006-08-01 16:56:32.000000000 +0200 @@ -458,7 +458,7 @@ /* * Build a list of pv_d's structures, allocated from mem. - * We keep track of the first object allocated form the pool + * We keep track of the first object allocated from the pool * so we can free off all the memory if something goes wrong. */ int read_pvs_in_vg(const struct format_type *fmt, const char *vg_name, diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/log/log.c new/LVM2.2.02.08/lib/log/log.c --- old/LVM2.2.02.07/lib/log/log.c 2006-05-12 21:16:48.000000000 +0200 +++ new/LVM2.2.02.08/lib/log/log.c 2006-08-01 16:56:33.000000000 +0200 @@ -32,6 +32,7 @@ static int _md_filtering = 0; static int _pvmove = 0; static int _full_scan_done = 0; /* Restrict to one full scan during each cmd */ +static int _trust_cache = 0; /* Don't scan when incomplete VGs encountered */ static int _debug_level = 0; static int _syslog = 0; static int _log_to_file = 0; @@ -163,6 +164,11 @@ _full_scan_done = level; } +void init_trust_cache(int trustcache) +{ + _trust_cache = trustcache; +} + void init_ignorelockingfailure(int level) { _ignorelockingfailure = level; @@ -237,6 +243,11 @@ return _full_scan_done; } +int trust_cache() +{ + return _trust_cache; +} + int lockingfailed() { return _lockingfailed; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/log/log.h new/LVM2.2.02.08/lib/log/log.h --- old/LVM2.2.02.07/lib/log/log.h 2006-05-12 21:16:48.000000000 +0200 +++ new/LVM2.2.02.08/lib/log/log.h 2006-08-01 16:56:33.000000000 +0200 @@ -66,6 +66,7 @@ void init_md_filtering(int level); void init_pvmove(int level); void init_full_scan_done(int level); +void init_trust_cache(int trustcache); void init_debug(int level); void init_cmd_name(int status); void init_msg_prefix(const char *prefix); @@ -83,6 +84,7 @@ int md_filtering(void); int pvmove_mode(void); int full_scan_done(void); +int trust_cache(void); int debug_level(void); int ignorelockingfailure(void); int lockingfailed(void); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/metadata/metadata.c new/LVM2.2.02.08/lib/metadata/metadata.c --- old/LVM2.2.02.07/lib/metadata/metadata.c 2006-07-04 21:36:49.000000000 +0200 +++ new/LVM2.2.02.08/lib/metadata/metadata.c 2006-08-09 21:33:25.000000000 +0200 @@ -722,23 +722,68 @@ int vg_validate(struct volume_group *vg) { - struct lv_list *lvl; + struct pv_list *pvl, *pvl2; + struct lv_list *lvl, *lvl2; + char uuid[64]; + int r = 1; + + list_iterate_items(pvl, &vg->pvs) { + list_iterate_items(pvl2, &vg->pvs) { + if (pvl == pvl2) + break; + if (id_equal(&pvl->pv->id, + &pvl2->pv->id)) { + if (!id_write_format(&pvl->pv->id, uuid, + sizeof(uuid))) + stack; + log_error("Internal error: Duplicate PV id " + "%s detected for %s in %s.", + uuid, dev_name(pvl->pv->dev), + vg->name); + r = 0; + } + } + } if (!check_pv_segments(vg)) { log_error("Internal error: PV segments corrupted in %s.", vg->name); - return 0; + r = 0; + } + + list_iterate_items(lvl, &vg->lvs) { + list_iterate_items(lvl2, &vg->lvs) { + if (lvl == lvl2) + break; + if (!strcmp(lvl->lv->name, lvl2->lv->name)) { + log_error("Internal error: Duplicate LV name " + "%s detected in %s.", lvl->lv->name, + vg->name); + r = 0; + } + if (id_equal(&lvl->lv->lvid.id[1], + &lvl2->lv->lvid.id[1])) { + if (!id_write_format(&lvl->lv->lvid.id[1], uuid, + sizeof(uuid))) + stack; + log_error("Internal error: Duplicate LV id " + "%s detected for %s and %s in %s.", + uuid, lvl->lv->name, lvl2->lv->name, + vg->name); + r = 0; + } + } } list_iterate_items(lvl, &vg->lvs) { if (!check_lv_segments(lvl->lv, 1)) { log_error("Internal error: LV segments corrupted in %s.", lvl->lv->name); - return 0; + r = 0; } } - return 1; + return r; } /* diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/lib/metadata/mirror.c new/LVM2.2.02.08/lib/metadata/mirror.c --- old/LVM2.2.02.07/lib/metadata/mirror.c 2006-05-12 21:47:40.000000000 +0200 +++ new/LVM2.2.02.08/lib/metadata/mirror.c 2006-07-20 22:37:10.000000000 +0200 @@ -199,6 +199,12 @@ /* Delete the 'orphan' LVs */ for (m = num_mirrors; m < old_area_count; m++) { + /* LV is now independent of the mirror so must acquire lock. */ + if (!activate_lv(mirrored_seg->lv->vg->cmd, seg_lv(mirrored_seg, m))) { + stack; + return 0; + } + if (!deactivate_lv(mirrored_seg->lv->vg->cmd, seg_lv(mirrored_seg, m))) { stack; return 0; @@ -211,6 +217,11 @@ } if (lv1) { + if (!activate_lv(mirrored_seg->lv->vg->cmd, lv1)) { + stack; + return 0; + } + if (!deactivate_lv(mirrored_seg->lv->vg->cmd, lv1)) { stack; return 0; @@ -223,6 +234,11 @@ } if (log_lv) { + if (!activate_lv(mirrored_seg->lv->vg->cmd, log_lv)) { + stack; + return 0; + } + if (!deactivate_lv(mirrored_seg->lv->vg->cmd, log_lv)) { stack; return 0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/scripts/clvmd_init_rhel4 new/LVM2.2.02.08/scripts/clvmd_init_rhel4 --- old/LVM2.2.02.07/scripts/clvmd_init_rhel4 2005-05-11 17:21:44.000000000 +0200 +++ new/LVM2.2.02.08/scripts/clvmd_init_rhel4 2006-07-19 20:55:58.000000000 +0200 @@ -119,9 +119,9 @@ status) status clvmd + rtrn=$? vols=$( $LVDISPLAY -C --nohead 2> /dev/null | awk '($3 ~ /....a./) {print $1}' ) echo active volumes: ${vols:-"(none)"} - rtrn=0 ;; *) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/tools/args.h new/LVM2.2.02.08/tools/args.h --- old/LVM2.2.02.07/tools/args.h 2006-05-16 18:48:31.000000000 +0200 +++ new/LVM2.2.02.08/tools/args.h 2006-08-01 16:56:33.000000000 +0200 @@ -49,6 +49,7 @@ arg(corelog_ARG, '\0', "corelog", NULL) arg(monitor_ARG, '\0', "monitor", yes_no_arg) arg(config_ARG, '\0', "config", string_arg) +arg(trustcache_ARG, '\0', "trustcache", NULL) /* Allow some variations */ arg(resizable_ARG, '\0', "resizable", yes_no_arg) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/tools/commands.h new/LVM2.2.02.08/tools/commands.h --- old/LVM2.2.02.07/tools/commands.h 2006-05-12 21:16:48.000000000 +0200 +++ new/LVM2.2.02.08/tools/commands.h 2006-08-01 16:56:33.000000000 +0200 @@ -343,6 +343,7 @@ "\t[-P|--partial] " "\n" "\t[--segments]\n" "\t[--separator Separator]\n" + "\t[--trustcache]\n" "\t[--unbuffered]\n" "\t[--units hsbkmgtHKMGT]\n" "\t[-v|--verbose]\n" @@ -351,7 +352,7 @@ aligned_ARG, all_ARG, ignorelockingfailure_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, segments_ARG, - separator_ARG, sort_ARG, unbuffered_ARG, units_ARG) + separator_ARG, sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG) xx(lvscan, "List all logical volumes in all volume groups", @@ -527,6 +528,7 @@ "\t[-P|--partial] " "\n" "\t[--segments]\n" "\t[--separator Separator]\n" + "\t[--trustcache]\n" "\t[--unbuffered]\n" "\t[--units hsbkmgtHKMGT]\n" "\t[-v|--verbose]\n" @@ -535,7 +537,7 @@ aligned_ARG, all_ARG, ignorelockingfailure_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, segments_ARG, - separator_ARG, sort_ARG, unbuffered_ARG, units_ARG) + separator_ARG, sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG) xx(pvscan, "List all physical volumes", @@ -819,6 +821,7 @@ "\t[-O|--sort [+|-]key1[,[+|-]key2[,...]]]\n" "\t[-P|--partial] " "\n" "\t[--separator Separator]\n" + "\t[--trustcache]\n" "\t[--unbuffered]\n" "\t[--units hsbkmgtHKMGT]\n" "\t[-v|--verbose]\n" @@ -827,7 +830,7 @@ aligned_ARG, all_ARG, ignorelockingfailure_ARG, noheadings_ARG, nolocking_ARG, nosuffix_ARG, options_ARG, partial_ARG, separator_ARG, - sort_ARG, unbuffered_ARG, units_ARG) + sort_ARG, trustcache_ARG, unbuffered_ARG, units_ARG) xx(vgscan, "Search for all volume groups", diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.07/tools/lvmcmdline.c new/LVM2.2.02.08/tools/lvmcmdline.c --- old/LVM2.2.02.07/tools/lvmcmdline.c 2006-05-16 18:48:31.000000000 +0200 +++ new/LVM2.2.02.08/tools/lvmcmdline.c 2006-08-01 16:56:33.000000000 +0200 @@ -707,6 +707,17 @@ return EINVALID_CMD_LINE; } + if (arg_count(cmd, trustcache_ARG)) { + if (arg_count(cmd, all_ARG)) { + log_error("--trustcache is incompatible with --all"); + return EINVALID_CMD_LINE; + } + init_trust_cache(1); + log_print("WARNING: Cache file of PVs will be trusted. " + "New devices holding PVs may get ignored."); + } else + init_trust_cache(0); + /* Handle synonyms */ if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) || !_merge_synonym(cmd, allocation_ARG, allocatable_ARG) || ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org