From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18274 invoked by alias); 1 Aug 2006 14:56:34 -0000 Received: (qmail 18260 invoked by uid 9447); 1 Aug 2006 14:56:34 -0000 Date: Tue, 01 Aug 2006 14:56:00 -0000 Message-ID: <20060801145634.18258.qmail@sourceware.org> From: agk@sourceware.org To: lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/cache/lvmcache.c lib/devi ... Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00000.txt.bz2 List-Id: CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2006-08-01 14:56:33 Modified files: . : WHATS_NEW lib/cache : lvmcache.c lib/device : dev-cache.c lib/format1 : disk-rep.c lib/log : log.c log.h tools : args.h commands.h lvmcmdline.c Log message: Add --trustcache option to reporting commands in preparation for supporting event-driven model. Without changes to the way the cache gets updated, the option is currently unreliable without a global lock to prevent any lvm2 commands from running concurrently. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.413&r2=1.414 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.h.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/args.h.diff?cvsroot=lvm2&r1=1.45&r2=1.46 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 --- LVM2/WHATS_NEW 2006/07/20 20:37:09 1.413 +++ LVM2/WHATS_NEW 2006/08/01 14:56:32 1.414 @@ -1,5 +1,6 @@ Version 2.02.08 - ================================ + Add unreliable --trustcache option to reporting commands. Fix locking for mimage removal. Fix clvmd_init_rhel4 'status' exit code. --- LVM2/lib/cache/lvmcache.c 2006/06/14 20:11:22 1.27 +++ LVM2/lib/cache/lvmcache.c 2006/08/01 14:56:32 1.28 @@ -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; } --- LVM2/lib/device/dev-cache.c 2006/04/19 15:33:06 1.44 +++ LVM2/lib/device/dev-cache.c 2006/08/01 14:56:32 1.45 @@ -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) */ --- LVM2/lib/format1/disk-rep.c 2006/05/11 18:39:24 1.63 +++ LVM2/lib/format1/disk-rep.c 2006/08/01 14:56:32 1.64 @@ -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, --- LVM2/lib/log/log.c 2006/05/12 19:16:48 1.33 +++ LVM2/lib/log/log.c 2006/08/01 14:56:33 1.34 @@ -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; --- LVM2/lib/log/log.h 2006/05/12 19:16:48 1.31 +++ LVM2/lib/log/log.h 2006/08/01 14:56:33 1.32 @@ -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); --- LVM2/tools/args.h 2006/05/16 16:48:31 1.45 +++ LVM2/tools/args.h 2006/08/01 14:56:33 1.46 @@ -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) --- LVM2/tools/commands.h 2006/05/12 19:16:48 1.84 +++ LVM2/tools/commands.h 2006/08/01 14:56:33 1.85 @@ -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", --- LVM2/tools/lvmcmdline.c 2006/05/16 16:48:31 1.31 +++ LVM2/tools/lvmcmdline.c 2006/08/01 14:56:33 1.32 @@ -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) ||