CVSROOT: /cvs/lvm2 Module name: htdocs Changes by: fche@server2.sourceware.org 2020-08-10 15:40:06 Modified files: . : index.html Log message: sources.redhat.com -> sourceware.org rename still need several more changes for post-2012 service urls Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/htdocs/index.html.diff?cvsroot=lvm2&r1=1.15&r2=1.16
CVSROOT: /cvs/lvm2 Module name: CVSROOT Changes by: agk@sourceware.org 2016-04-15 23:19:53 Modified files: . : loginfo Log message: Disable website hook. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/CVSROOT/loginfo.diff?cvsroot=lvm2&r1=1.7&r2=1.8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- ViewVC :: http://www.viewvc.org/ --> <head> <title>ViewVC Repository Listing</title> <meta name="generator" content="ViewVC 1.1.24" /> <meta name="robots" content="noindex, nofollow" /> <!-- fche 2016-03-15 --> <link rel="shortcut icon" href="/viewvc-static/images/favicon.ico" /> <link rel="stylesheet" href="/viewvc-static/styles.css" type="text/css" /> </head> <body> <div class="vc_navheader"> <table><tr> <td><strong><a href="/viewvc"><span class="pathdiv">/</span></a></strong></td> <td style="text-align: right;"></td> </tr></table> </div> <div style="float: right; padding: 5px;"><a href="http://www.viewvc.org/" title="ViewVC Home"><img src="/viewvc-static/images/viewvc-logo.png" alt="ViewVC logotype" width="240" height="70" /></a></div> <h1>Repository Listing</h1> <table cellspacing="1" cellpadding="2"> <thead> <tr> <th class="vc_header_sort">Name</th> </tr> </thead> <tbody> <tr class="vc_row_even"> <td> <a href="/viewvc/cygwin-apps/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> cygwin-apps</a> </td> </tr> <tr class="vc_row_odd"> <td> <a href="/viewvc/ecos/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> ecos</a> </td> </tr> <tr class="vc_row_even"> <td> <a href="/viewvc/gcc/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> gcc</a> </td> </tr> <tr class="vc_row_odd"> <td> <a href="/viewvc/kawa/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> kawa</a> </td> </tr> <tr class="vc_row_even"> <td> <a href="/viewvc/src/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> src</a> </td> </tr> </tbody> </table> <hr /> <table> <tr> <td> </td> <td style="text-align: right;"><strong><a href="/viewvc-static/help_rootview.html">ViewVC Help</a></strong></td> </tr> <tr> <td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.24</a></td> <td style="text-align: right;"> </td> </tr> </table> </body> </html>
CVSROOT: /cvs/lvm2 Module name: CVSROOT Changes by: agk@sourceware.org 2016-04-15 23:14:23 Modified files: . : modules Log message: Disable website hook. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/CVSROOT/modules.diff?cvsroot=lvm2&r1=1.2&r2=1.3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- ViewVC :: http://www.viewvc.org/ --> <head> <title>ViewVC Repository Listing</title> <meta name="generator" content="ViewVC 1.1.24" /> <meta name="robots" content="noindex, nofollow" /> <!-- fche 2016-03-15 --> <link rel="shortcut icon" href="/viewvc-static/images/favicon.ico" /> <link rel="stylesheet" href="/viewvc-static/styles.css" type="text/css" /> </head> <body> <div class="vc_navheader"> <table><tr> <td><strong><a href="/viewvc"><span class="pathdiv">/</span></a></strong></td> <td style="text-align: right;"></td> </tr></table> </div> <div style="float: right; padding: 5px;"><a href="http://www.viewvc.org/" title="ViewVC Home"><img src="/viewvc-static/images/viewvc-logo.png" alt="ViewVC logotype" width="240" height="70" /></a></div> <h1>Repository Listing</h1> <table cellspacing="1" cellpadding="2"> <thead> <tr> <th class="vc_header_sort">Name</th> </tr> </thead> <tbody> <tr class="vc_row_even"> <td> <a href="/viewvc/cygwin-apps/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> cygwin-apps</a> </td> </tr> <tr class="vc_row_odd"> <td> <a href="/viewvc/ecos/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> ecos</a> </td> </tr> <tr class="vc_row_even"> <td> <a href="/viewvc/gcc/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> gcc</a> </td> </tr> <tr class="vc_row_odd"> <td> <a href="/viewvc/kawa/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> kawa</a> </td> </tr> <tr class="vc_row_even"> <td> <a href="/viewvc/src/"> <img src="/viewvc-static/images/dir.png" alt="" class="vc_icon" /> src</a> </td> </tr> </tbody> </table> <hr /> <table> <tr> <td> </td> <td style="text-align: right;"><strong><a href="/viewvc-static/help_rootview.html">ViewVC Help</a></strong></td> </tr> <tr> <td>Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.1.24</a></td> <td style="text-align: right;"> </td> </tr> </table> </body> </html>
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-09-17 15:58:31 Modified files: . : README WHATS_NEW WHATS_NEW_DM Log message: Change new lvm2 git URLs from upper-case to lowercase. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/README.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2410&r2=1.2411 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.604&r2=1.605 --- LVM2/README 2012/06/07 14:28:32 1.9 +++ LVM2/README 2012/09/17 15:58:30 1.10 @@ -4,8 +4,8 @@ On 7th June 2012, we froze this copy of the source code and moved it to fedorahosted.org: - http://git.fedorahosted.org/git/LVM2.git - git clone git://git.fedorahosted.org/git/LVM2.git + http://git.fedorahosted.org/git/lvm2.git + git clone git://git.fedorahosted.org/git/lvm2.git ------------------------------------------------------------------------------- --- LVM2/WHATS_NEW 2012/06/07 14:28:32 1.2410 +++ LVM2/WHATS_NEW 2012/09/17 15:58:30 1.2411 @@ -1,8 +1,8 @@ On 7th June 2012, we froze this copy of the source code and moved it to fedorahosted.org: - http://git.fedorahosted.org/git/LVM2.git - git clone git://git.fedorahosted.org/git/LVM2.git + http://git.fedorahosted.org/git/lvm2.git + git clone git://git.fedorahosted.org/git/lvm2.git -------------------------------------------------------------------------------- --- LVM2/WHATS_NEW_DM 2012/06/07 14:28:32 1.604 +++ LVM2/WHATS_NEW_DM 2012/09/17 15:58:31 1.605 @@ -1,8 +1,8 @@ On 7th June 2012, we froze this copy of the source code and moved it to fedorahosted.org: - http://git.fedorahosted.org/git/LVM2.git - git clone git://git.fedorahosted.org/git/LVM2.git + http://git.fedorahosted.org/git/lvm2.git + git clone git://git.fedorahosted.org/git/lvm2.git --------------------------------------------------------------------------------
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-06-07 14:28:32 Modified files: . : README WHATS_NEW WHATS_NEW_DM Log message: Indicate new location of source code. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/README.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2409&r2=1.2410 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.603&r2=1.604 --- LVM2/README 2008/11/04 17:49:22 1.8 +++ LVM2/README 2012/06/07 14:28:32 1.9 @@ -1,3 +1,14 @@ +NEWS +---- + +On 7th June 2012, we froze this copy of the source code and moved it to +fedorahosted.org: + + http://git.fedorahosted.org/git/LVM2.git + git clone git://git.fedorahosted.org/git/LVM2.git + +------------------------------------------------------------------------------- + This tree contains the LVM2 and device-mapper tools and libraries. For more information about LVM2 read the changelog in the WHATS_NEW file. --- LVM2/WHATS_NEW 2012/05/23 13:02:36 1.2409 +++ LVM2/WHATS_NEW 2012/06/07 14:28:32 1.2410 @@ -1,3 +1,11 @@ +On 7th June 2012, we froze this copy of the source code and moved it to +fedorahosted.org: + + http://git.fedorahosted.org/git/LVM2.git + git clone git://git.fedorahosted.org/git/LVM2.git + +-------------------------------------------------------------------------------- + Version 2.02.96 - ================================ Fix error paths for regex filter initialization. --- LVM2/WHATS_NEW_DM 2012/05/29 08:09:10 1.603 +++ LVM2/WHATS_NEW_DM 2012/06/07 14:28:32 1.604 @@ -1,3 +1,11 @@ +On 7th June 2012, we froze this copy of the source code and moved it to +fedorahosted.org: + + http://git.fedorahosted.org/git/LVM2.git + git clone git://git.fedorahosted.org/git/LVM2.git + +-------------------------------------------------------------------------------- + Version 1.02.75 - ================================ Remove unsupported udev_get_dev_path libudev call used for checking udev dir.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2012-05-29 08:09:13 Modified files: . : WHATS_NEW_DM lib/commands : toolcontext.c lib/misc : lvm-wrappers.c lvm-wrappers.h libdm : libdevmapper.h tools : dmsetup.c Log message: Remove unsupported udev_get_dev_path libudev call used for checking udev dir. With latest changes in the udev, some deprecated functions were removed from libudev amongst which there was the "udev_get_dev_path" function we used to compare a device directory used in udev and directore set in libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183). Amongst other changes and from packager's point of view, it's also important to note that the libudev development library ("libudev-devel") could now be a part of the systemd development library ("systemd-devel") because of the udev + systemd merge. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.602&r2=1.603 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.157&r2=1.158 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-wrappers.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-wrappers.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.187&r2=1.188 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.189&r2=1.190 --- LVM2/WHATS_NEW_DM 2012/05/15 21:27:24 1.602 +++ LVM2/WHATS_NEW_DM 2012/05/29 08:09:10 1.603 @@ -1,5 +1,6 @@ Version 1.02.75 - ================================ + Remove unsupported udev_get_dev_path libudev call used for checking udev dir. Set delay_resume_if_new on deptree snapshot origin. Log value chosen in _find_config_bool like other variable types do. Synchronize with dead of dmeventd. --- LVM2/lib/commands/toolcontext.c 2012/05/23 13:02:37 1.157 +++ LVM2/lib/commands/toolcontext.c 2012/05/29 08:09:10 1.158 @@ -650,9 +650,9 @@ { const struct dm_config_node *cn; const struct dm_config_value *cv; - size_t uninitialized_var(udev_dir_len), len; + size_t len, udev_dir_len = strlen(DM_UDEV_DEV_DIR); + int len_diff; int device_list_from_udev; - const char *uninitialized_var(udev_dir); init_dev_disable_after_error_count( find_config_tree_int(cmd, "devices/disable_after_error_count", @@ -661,13 +661,9 @@ if (!dev_cache_init(cmd)) return_0; - if ((device_list_from_udev = udev_is_running() ? + device_list_from_udev = udev_is_running() ? find_config_tree_bool(cmd, "devices/obtain_device_list_from_udev", - DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0)) { - if (!(udev_dir = udev_get_dev_dir())) - stack; - udev_dir_len = (udev_dir) ? strlen(udev_dir) : 0; - } + DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0; init_obtain_device_list_from_udev(device_list_from_udev); if (!(cn = find_config_tree_node(cmd, "devices/scan"))) { @@ -688,11 +684,19 @@ return 0; } - if (device_list_from_udev && udev_dir) { + if (device_list_from_udev) { len = strlen(cv->v.str); - len = udev_dir_len > len ? len : udev_dir_len; - if (strncmp(udev_dir, cv->v.str, len) || - udev_dir[len] != cv->v.str[len]) { + + /* + * DM_UDEV_DEV_DIR always has '/' at its end. + * If the item in the conf does not have it, be sure + * to make the right comparison without the '/' char! + */ + len_diff = len && cv->v.str[len - 1] != '/' ? + udev_dir_len - 1 != len : + udev_dir_len != len; + + if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) { device_list_from_udev = 0; init_obtain_device_list_from_udev(0); } --- LVM2/lib/misc/lvm-wrappers.c 2011/04/22 12:00:00 1.4 +++ LVM2/lib/misc/lvm-wrappers.c 2012/05/29 08:09:11 1.5 @@ -65,16 +65,6 @@ return 0; } -const char *udev_get_dev_dir(void) -{ - if (!_udev) { - log_debug(_no_context_msg); - return NULL; - } - - return udev_get_dev_path(_udev); -} - struct udev* udev_get_library_context(void) { return _udev; @@ -96,10 +86,6 @@ return 0; } -const char *udev_get_dev_dir(void) -{ - return NULL; -} #endif int lvm_getpagesize(void) --- LVM2/lib/misc/lvm-wrappers.h 2011/04/22 12:00:00 1.5 +++ LVM2/lib/misc/lvm-wrappers.h 2012/05/29 08:09:11 1.6 @@ -24,7 +24,6 @@ int udev_init_library_context(void); void udev_fin_library_context(void); int udev_is_running(void); -const char *udev_get_dev_dir(void); int lvm_getpagesize(void); --- LVM2/libdm/libdevmapper.h 2012/03/02 17:31:22 1.187 +++ LVM2/libdm/libdevmapper.h 2012/05/29 08:09:11 1.188 @@ -1500,6 +1500,9 @@ struct dm_pool *dm_config_memory(struct dm_config_tree *cft); +/* Udev device directory. */ +#define DM_UDEV_DEV_DIR "/dev/" + /* Cookie prefixes. * * The cookie value consists of a prefix (16 bits) and a base (16 bits). --- LVM2/tools/dmsetup.c 2012/04/24 08:24:36 1.189 +++ LVM2/tools/dmsetup.c 2012/05/29 08:09:12 1.190 @@ -1008,11 +1008,9 @@ #else /* UDEV_SYNC_SUPPORT */ static int _set_up_udev_support(const char *dev_dir) { - struct udev *udev; - const char *udev_dev_dir; - size_t udev_dev_dir_len; int dirs_diff; const char *env; + size_t len = strlen(dev_dir), udev_dir_len = strlen(DM_UDEV_DEV_DIR); if (_switches[NOUDEVSYNC_ARG]) dm_udev_set_sync_support(0); @@ -1030,14 +1028,6 @@ " defined by --udevcookie option.", _udev_cookie); - if (!(udev = udev_new()) || - !(udev_dev_dir = udev_get_dev_path(udev)) || - !*udev_dev_dir) { - log_error("Could not get udev dev path."); - return 0; - } - udev_dev_dir_len = strlen(udev_dev_dir); - /* * Normally, there's always a fallback action by libdevmapper if udev * has not done its job correctly, e.g. the nodes were not created. @@ -1049,12 +1039,17 @@ * is the same as "dev path" used by libdevmapper. */ - /* There's always a slash at the end of dev_dir. But check udev_dev_dir! */ - if (udev_dev_dir[udev_dev_dir_len - 1] != '/') - dirs_diff = strncmp(dev_dir, udev_dev_dir, udev_dev_dir_len); - else - dirs_diff = strcmp(dev_dir, udev_dev_dir); + /* + * DM_UDEV_DEV_DIR always has '/' at its end. + * If the dev_dir does not have it, be sure + * to make the right comparison without the '/' char! + */ + if (dev_dir[len - 1] != '/') + udev_dir_len--; + + dirs_diff = udev_dir_len != len || + strncmp(DM_UDEV_DEV_DIR, dev_dir, len); _udev_only = !dirs_diff && (_udev_cookie || !_switches[VERIFYUDEV_ARG]); if (dirs_diff) { @@ -1064,11 +1059,10 @@ "about udev not working correctly while processing " "particular nodes will be suppressed. These nodes " "and symlinks will be managed in each directory " - "separately.", dev_dir, udev_dev_dir); + "separately.", dev_dir, DM_UDEV_DEV_DIR); dm_udev_set_checking(0); } - udev_unref(udev); return 1; }
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-05-23 13:02:37 Modified files: . : WHATS_NEW lib/commands : toolcontext.c Log message: Fix error path Do not increase nr_filt in case of NULL ret value, since the error path doesn't handle NULL pointers. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2408&r2=1.2409 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157 --- LVM2/WHATS_NEW 2012/05/16 13:09:09 1.2408 +++ LVM2/WHATS_NEW 2012/05/23 13:02:36 1.2409 @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Fix error paths for regex filter initialization. Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) Fix alloc cling to cling to PVs already found with contiguous policy. Fix cling policy not to behave like normal policy if no previous LV seg. --- LVM2/lib/commands/toolcontext.c 2012/03/23 09:42:36 1.156 +++ LVM2/lib/commands/toolcontext.c 2012/05/23 13:02:37 1.157 @@ -759,17 +759,19 @@ log_very_verbose("devices/filter not found in config file: " "no regex filter installed"); - else if (!(filters[nr_filt++] = regex_filter_create(cn->v))) { + else if (!(filters[nr_filt] = regex_filter_create(cn->v))) { log_error("Failed to create regex device filter"); goto bad; - } + } else + nr_filt++; /* device type filter. Required. */ cn = find_config_tree_node(cmd, "devices/types"); - if (!(filters[nr_filt++] = lvm_type_filter_create(cmd->proc_dir, cn))) { + if (!(filters[nr_filt] = lvm_type_filter_create(cmd->proc_dir, cn))) { log_error("Failed to create lvm type filter"); goto bad; } + nr_filt++; /* md component filter. Optional, non-critical. */ if (find_config_tree_bool(cmd, "devices/md_component_detection",
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-05-23 12:59:35 Modified files: doc : example.conf.in Log message: Move thin_check_executable to proper section It's read from global section. In-release change, so no what's new Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/doc/example.conf.in.diff?cvsroot=lvm2&r1=1.50&r2=1.51 --- LVM2/doc/example.conf.in 2012/05/14 16:29:50 1.50 +++ LVM2/doc/example.conf.in 2012/05/23 12:59:35 1.51 @@ -467,6 +467,21 @@ # proper udev rules, all changes in block device configuration will be # *ignored* until a manual 'vgscan' is performed. use_lvmetad = 0 + + # Full path of the utility called to check that a thin metadata device + # is in a state that allows it to be used. + # Each time a thin pool needs to be activated or after it is deactivated + # this utility is executed. The activation will only proceed if the utility + # has an exit status of 0. + # Set to "" to skip this check. (Not recommended.) + # The thin tools are available as part of the device-mapper-persistent-data + # package from https://github.com/jthornber/thin-provisioning-tools. + # + thin_check_executable = "@THIN_CHECK_CMD@" + + # String with options passed with thin_check command. By default, + # option '-q' is for quiet output. + thin_check_options = [ "-q" ] } activation { @@ -654,20 +669,6 @@ thin_pool_autoextend_threshold = 100 thin_pool_autoextend_percent = 20 - # Full path of the utility called to check that a thin metadata device - # is in a state that allows it to be used. - # Each time a thin pool needs to be activated, this utility is executed. - # The activation will only proceed if the utility has an exit status of 0. - # Set to "" to skip this check. (Not recommended.) - # The thin tools are available as part of the device-mapper-persistent-data - # package from https://github.com/jthornber/thin-provisioning-tools. - # - thin_check_executable = "@THIN_CHECK_CMD@" - - # String with options passed with thin_check command. By default, - # option '-q' is for quiet output. - thin_check_options = [ "-q" ] - # While activating devices, I/O to devices being (re)configured is # suspended, and as a precaution against deadlocks, LVM2 needs to pin # any memory it is using so it is not paged out. Groups of pages that
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2012-05-17 12:03:30 Modified files: test/shell : activate-missing-segment.sh Log message: Partial activation working, expect success in tests. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/activate-missing-segment.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/test/shell/activate-missing-segment.sh 2012/05/16 10:44:36 1.1 +++ LVM2/test/shell/activate-missing-segment.sh 2012/05/17 12:03:30 1.2 @@ -19,7 +19,6 @@ . lib/test aux prepare_vg 2 -aux expect_failure lvcreate -l100%FREE -n span $vg vgchange -a n $vg
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2012-05-17 08:04:11 Modified files: test/shell : lvconvert-repair-snapshot.sh snapshots-of-mirrors.sh Log message: Re-enable tests for snapshots of mirrors. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/lvconvert-repair-snapshot.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/snapshots-of-mirrors.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 --- LVM2/test/shell/lvconvert-repair-snapshot.sh 2012/05/01 19:21:25 1.3 +++ LVM2/test/shell/lvconvert-repair-snapshot.sh 2012/05/17 08:04:11 1.4 @@ -11,13 +11,6 @@ . lib/test -exit 0 -# -# Snapshots of 'mirrors' are not supported. They can no longer be created. -# This file could be used to test some aspect of lvconvert, snapshot, and -# RAID at some point though... -# - aux prepare_vg 5 aux lvmconf 'allocation/maximise_cling = 0' aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1' --- LVM2/test/shell/snapshots-of-mirrors.sh 2012/05/16 15:01:06 1.4 +++ LVM2/test/shell/snapshots-of-mirrors.sh 2012/05/17 08:04:11 1.5 @@ -18,12 +18,6 @@ lvcreate -s $vg/lv -L 10M -n snap -exit 0 - -# -# Snapshots of mirrors are no longer allowed. -# - # Down-convert (mirror -> linear) under a snapshot lvconvert -m0 $vg/lv
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-05-16 15:01:06 Modified files: test/shell : snapshots-of-mirrors.sh Log message: snaps of mirrors are enabled Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/snapshots-of-mirrors.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 --- LVM2/test/shell/snapshots-of-mirrors.sh 2012/05/01 19:21:25 1.3 +++ LVM2/test/shell/snapshots-of-mirrors.sh 2012/05/16 15:01:06 1.4 @@ -15,7 +15,8 @@ # Attempt to create snapshot of a mirror origin - should fail lvcreate -m 1 -L 10M -n lv $vg -not lvcreate -s $vg/lv -L 10M -n snap + +lvcreate -s $vg/lv -L 10M -n snap exit 0
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-05-16 13:09:09 Modified files: . : WHATS_NEW Log message: ok - that was nice mid-air collision Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2407&r2=1.2408 --- LVM2/WHATS_NEW 2012/05/16 13:06:18 1.2407 +++ LVM2/WHATS_NEW 2012/05/16 13:09:09 1.2408 @@ -1,6 +1,5 @@ Version 2.02.96 - ================================ - Fix partial activation of volumes (2.02.90) Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) Fix alloc cling to cling to PVs already found with contiguous policy. Fix cling policy not to behave like normal policy if no previous LV seg.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-05-16 13:06:19 Modified files: . : WHATS_NEW Log message: update Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2406&r2=1.2407 --- LVM2/WHATS_NEW 2012/05/16 12:50:14 1.2406 +++ LVM2/WHATS_NEW 2012/05/16 13:06:18 1.2407 @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Fix partial activation of volumes (2.02.90) Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) Fix alloc cling to cling to PVs already found with contiguous policy. Fix cling policy not to behave like normal policy if no previous LV seg.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-16 12:50:16 Modified files: . : WHATS_NEW lib/activate : dev_manager.c Log message: Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) - The test should be checking the LV as a whole, not just individual segments. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2405&r2=1.2406 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.278&r2=1.279 --- LVM2/WHATS_NEW 2012/05/14 16:18:58 1.2405 +++ LVM2/WHATS_NEW 2012/05/16 12:50:14 1.2406 @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) Fix alloc cling to cling to PVs already found with contiguous policy. Fix cling policy not to behave like normal policy if no previous LV seg. Fix allocation loop not to use later policies when --alloc cling without tags. --- LVM2/lib/activate/dev_manager.c 2012/04/24 00:51:26 1.278 +++ LVM2/lib/activate/dev_manager.c 2012/05/16 12:50:15 1.279 @@ -1581,22 +1581,6 @@ seg->lv->vg->name, seg->lv->name); return 0; } - - /* - * Mirrors activate LVs replaced with error targets and - * RAID can handle non-accessible sub-LVs. - * - * TODO: Can we eventually skip to activate such LVs ? - */ - if (!num_existing_areas && - !strstr(seg->lv->name, "_rmeta_") && - !strstr(seg->lv->name, "_rimage_") && - !strstr(seg->lv->name, "_mimage_") && - !((name = strstr(seg->lv->name, "_mlog")) && !name[5])) { - log_error("Cannot activate %s/%s: all segments missing.", - seg->lv->vg->name, seg->lv->name); - return 0; - } } return 1;
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2012-05-16 10:44:36 Added files: test/shell : activate-missing-segment.sh Log message: Add a (currently failing) test for RHBZ 816672. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/activate-missing-segment.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 /cvs/lvm2/LVM2/test/shell/activate-missing-segment.sh,v --> standard output revision 1.1 --- LVM2/test/shell/activate-missing-segment.sh +++ - 2012-05-16 10:44:36.820286000 +0000 @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (C) 2010 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 +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Test activation behaviour with devices missing. +# - snapshots and their origins are only activated together; if one fails, both +# fail +# - partial mirrors are not activated (but maybe they should? maybe we should +# instead lvconvert --repair them?) +# - linear LVs with bits missing are not activated + +. lib/test + +aux prepare_vg 2 +aux expect_failure + +lvcreate -l100%FREE -n span $vg +vgchange -a n $vg + +aux disable_dev "$dev1" +not vgchange -a y $vg +vgchange -a y --partial $vg +check active $vg span
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2012-05-16 10:43:42 Modified files: test/lib : aux.sh harness.c Log message: Add provisions to flag tests that we know will fail, without flagging the build (i.e. an expected failure). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/aux.sh.diff?cvsroot=lvm2&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/harness.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13 --- LVM2/test/lib/aux.sh 2012/03/28 11:10:09 1.49 +++ LVM2/test/lib/aux.sh 2012/05/16 10:43:41 1.50 @@ -17,6 +17,10 @@ exec "${VALGRIND:-valg}" "$@" } +expect_failure() { + echo "TEST EXPECT FAILURE" +} + prepare_clvmd() { test "${LVM_TEST_LOCKING:-0}" -ne 3 && return # not needed --- LVM2/test/lib/harness.c 2012/03/12 14:24:15 1.12 +++ LVM2/test/lib/harness.c 2012/05/16 10:43:41 1.13 @@ -32,6 +32,7 @@ int nfailed; int nskipped; int npassed; + int nknownfail; int nwarned; int status[MAX]; }; @@ -55,6 +56,7 @@ #define SKIPPED 1 #define FAILED 2 #define WARNED 3 +#define KNOWNFAIL 4 static void handler( int sig ) { signal( sig, SIG_DFL ); @@ -227,7 +229,11 @@ } static void passed(int i, char *f, time_t t) { - if (readbuf && strstr(readbuf, "TEST WARNING")) { + if (readbuf && strstr(readbuf, "TEST EXPECT FAIL")) { + ++ s.npassed; + s.status[i] = PASSED; + printf("passed (UNEXPECTED). %s\n", duration(t)); + } else if (readbuf && strstr(readbuf, "TEST WARNING")) { ++s.nwarned; s.status[i] = WARNED; printf("warnings %s\n", duration(t)); @@ -245,6 +251,13 @@ } static void failed(int i, char *f, int st) { + if (readbuf && strstr(readbuf, "TEST EXPECT FAIL")) { + printf("FAILED (expected).\n"); + s.status[i] = KNOWNFAIL; + ++ s.nknownfail; + return; + } + ++ s.nfailed; s.status[i] = FAILED; if(die == 2) { @@ -343,18 +356,21 @@ break; } - printf("\n## %d tests %s : %d OK, %d warnings, %d failures; %d skipped\n", + printf("\n## %d tests %s : %d OK, %d warnings, %d failures, %d known failures; %d skipped\n", s.nwarned + s.npassed + s.nfailed + s.nskipped, duration(start), - s.npassed, s.nwarned, s.nfailed, s.nskipped); + s.npassed, s.nwarned, s.nfailed, s.nknownfail, s.nskipped); /* print out a summary */ - if (s.nfailed || s.nskipped) { + if (s.nfailed || s.nskipped || s.nknownfail) { for (i = 1; i < argc; ++ i) { switch (s.status[i]) { case FAILED: printf("FAILED: %s\n", argv[i]); break; + case KNOWNFAIL: + printf("FAILED (expected): %s\n", argv[i]); + break; case SKIPPED: printf("skipped: %s\n", argv[i]); break;
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-15 21:27:25 Modified files: . : WHATS_NEW_DM libdm : libdm-deptree.c Log message: Set delay_resume_if_new on deptree snapshot origin. (Must avoid activating snapshot origin more than once concurrently.) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.601&r2=1.602 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.165&r2=1.166 --- LVM2/WHATS_NEW_DM 2012/05/08 14:31:44 1.601 +++ LVM2/WHATS_NEW_DM 2012/05/15 21:27:24 1.602 @@ -1,5 +1,6 @@ Version 1.02.75 - ================================ + Set delay_resume_if_new on deptree snapshot origin. Log value chosen in _find_config_bool like other variable types do. Synchronize with dead of dmeventd. Rename (Blk)DevNames/DevNos dmsetup header to (Blk)DevNamesUsed/DevNosUsed. --- LVM2/libdm/libdm-deptree.c 2012/05/15 20:03:12 1.165 +++ LVM2/libdm/libdm-deptree.c 2012/05/15 21:27:24 1.166 @@ -2358,8 +2358,10 @@ if ((r = dm_task_run(dmt))) { r = dm_task_get_info(dmt, &dnode->info); if (r && !dnode->info.inactive_table) - log_verbose("Suppressed %s identical table reload.", - dnode->name); + log_verbose("Suppressed %s (%" PRIu32 ":%" PRIu32 + ") identical table reload.", + dnode->name, + dnode->info.major, dnode->info.minor); existing_table_size = dm_task_get_existing_table_size(dmt); if ((dnode->props.size_changed = @@ -2548,6 +2550,12 @@ /* Resume snapshot origins after new snapshots */ dnode->activation_priority = 1; + /* + * Don't resume the origin immediately in case it is a non-trivial + * target that must not be active more than once concurrently! + */ + origin_node->props.delay_resume_if_new = 1; + return 1; }
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-15 20:03:13 Modified files: libdm : libdm-deptree.c Log message: add major:minor to table size changed debug message Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.164&r2=1.165 --- LVM2/libdm/libdm-deptree.c 2012/05/15 14:10:54 1.164 +++ LVM2/libdm/libdm-deptree.c 2012/05/15 20:03:12 1.165 @@ -2373,8 +2373,9 @@ dnode->props.size_changed = 0; log_debug("Table size changed from %" PRIu64 " to %" - PRIu64 " for %s.%s", existing_table_size, - seg_start, dnode->name, + PRIu64 " for %s (%" PRIu32 ":%" PRIu32 ").%s", + existing_table_size, seg_start, dnode->name, + dnode->info.major, dnode->info.minor, dnode->props.size_changed ? "" : " (Ignoring.)"); } }
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-15 14:10:54 Modified files: libdm : libdm-deptree.c Log message: indicate when deptree detects but ignores size change in debug msg Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.163&r2=1.164 --- LVM2/libdm/libdm-deptree.c 2012/03/04 17:36:24 1.163 +++ LVM2/libdm/libdm-deptree.c 2012/05/15 14:10:54 1.164 @@ -2364,9 +2364,6 @@ existing_table_size = dm_task_get_existing_table_size(dmt); if ((dnode->props.size_changed = (existing_table_size == seg_start) ? 0 : 1)) { - log_debug("Table size changed from %" PRIu64 " to %" - PRIu64 " for %s", existing_table_size, - seg_start, dnode->name); /* * Kernel usually skips size validation on zero-length devices * now so no need to preload them. @@ -2374,6 +2371,11 @@ /* FIXME In which kernel version did this begin? */ if (!existing_table_size && dnode->props.delay_resume_if_new) dnode->props.size_changed = 0; + + log_debug("Table size changed from %" PRIu64 " to %" + PRIu64 " for %s.%s", existing_table_size, + seg_start, dnode->name, + dnode->props.size_changed ? "" : " (Ignoring.)"); } }
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-14 16:29:51 Modified files: doc : example.conf.in Log message: Refer to details of snapshot of raid problem. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/doc/example.conf.in.diff?cvsroot=lvm2&r1=1.49&r2=1.50 --- LVM2/doc/example.conf.in 2012/05/10 00:18:49 1.49 +++ LVM2/doc/example.conf.in 2012/05/14 16:29:50 1.50 @@ -430,8 +430,12 @@ # "mirror" - The original RAID1 implementation provided by LVM2/DM. It is # characterized by a flexible log solution (core, disk, mirrored) # and by the necessity to block I/O while reconfiguring in the - # event of a failure. Snapshots of this type of RAID1 can be - # problematic. + # event of a failure. + # + # There is an inherent race in the dmeventd failure handling + # logic with snapshots of devices using this type of RAID1 that + # in the worst case could cause a deadlock. + # Ref: https://bugzilla.redhat.com/show_bug.cgi?id=817130#c10 # # "raid1" - This implementation leverages MD's RAID1 personality through # device-mapper. It is characterized by a lack of log options.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-14 16:18:58 Modified files: lib/metadata : lv_manip.c . : WHATS_NEW Log message: Warn of deadlock risk when using snapshots of mirror segment type. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.380&r2=1.381 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2404&r2=1.2405 --- LVM2/lib/metadata/lv_manip.c 2012/05/11 22:53:13 1.380 +++ LVM2/lib/metadata/lv_manip.c 2012/05/14 16:18:57 1.381 @@ -4231,9 +4231,9 @@ if (lv_is_mirror_type(org) && !seg_is_raid(first_seg(org))) { - log_error("Snapshots of \"mirror\" segment types" - " are not supported"); - return NULL; + log_warn("WARNING: Snapshots of mirrors can deadlock under rare device failures."); + log_warn("WARNING: Consider using the raid1 mirror type to avoid this."); + log_warn("WARNING: See global/mirror_segtype_default in lvm.conf."); } if (!lv_info(cmd, org, 0, &info, 0, 0)) { --- LVM2/WHATS_NEW 2012/05/11 22:53:13 1.2404 +++ LVM2/WHATS_NEW 2012/05/14 16:18:58 1.2405 @@ -9,7 +9,7 @@ Add initial support for thin pool lvconvert. Fix lvrename for thin volumes (regression in for_each_sub_lv() 2.02.89). Fix up-convert when mirror activation is controled by volume_list and tags. - Disallow snapshots of mirror segment type. + Warn of deadlock risk when using snapshots of mirror segment type. Fix bug in cmirror that caused incorrect status info to print on some nodes. Remove statement that snapshots cannot be tagged from lvm man page. Disallow changing cluster attribute of VG while RAID LVs are active.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-11 22:53:13 Modified files: lib/metadata : lv_manip.c . : WHATS_NEW Log message: Fix cling policy not to behave like normal policy if no previous LV seg. Fix alloc cling to cling to PVs already found with contiguous policy. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.379&r2=1.380 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2403&r2=1.2404 --- LVM2/lib/metadata/lv_manip.c 2012/05/11 22:19:12 1.379 +++ LVM2/lib/metadata/lv_manip.c 2012/05/11 22:53:13 1.380 @@ -910,13 +910,18 @@ if (alloc_parms->prev_lvseg) { if (alloc_parms->alloc == ALLOC_CONTIGUOUS) alloc_parms->flags |= A_CONTIGUOUS_TO_LVSEG; - else if (alloc_parms->alloc == ALLOC_CLING) + else if ((alloc_parms->alloc == ALLOC_CLING) || (alloc_parms->alloc == ALLOC_CLING_BY_TAGS)) alloc_parms->flags |= A_CLING_TO_LVSEG; - else if (alloc_parms->alloc == ALLOC_CLING_BY_TAGS) { - alloc_parms->flags |= A_CLING_TO_LVSEG; - alloc_parms->flags |= A_CLING_BY_TAGS; - } - } + } else + /* + * A cling allocation that follows a successful contiguous allocation + * must use the same PVs (or else fail). + */ + if ((alloc_parms->alloc == ALLOC_CLING) || (alloc_parms->alloc == ALLOC_CLING_BY_TAGS)) + alloc_parms->flags |= A_CLING_TO_ALLOCED; + + if (alloc_parms->alloc == ALLOC_CLING_BY_TAGS) + alloc_parms->flags |= A_CLING_BY_TAGS; /* * For normal allocations, if any extents have already been found @@ -1435,7 +1440,8 @@ /* * Is pva on same PV as any areas already used in this allocation attempt? */ -static int _check_cling_to_alloced(struct alloc_handle *ah, struct pv_area *pva, struct alloc_state *alloc_state) +static int _check_cling_to_alloced(struct alloc_handle *ah, const struct dm_config_node *cling_tag_list_cn, + struct pv_area *pva, struct alloc_state *alloc_state) { unsigned s; struct alloced_area *aa; @@ -1451,7 +1457,8 @@ if (alloc_state->areas[s].pva) continue; /* Area already assigned */ dm_list_iterate_items(aa, &ah->alloced_areas[s]) { - if (pva->map->pv == aa[0].pv) { + if ((!cling_tag_list_cn && (pva->map->pv == aa[0].pv)) || + (cling_tag_list_cn && _pvs_have_matching_tag(cling_tag_list_cn, pva->map->pv, aa[0].pv))) { _reserve_area(&alloc_state->areas[s], pva, pva->count, s + 1, 0); return 1; } @@ -1505,29 +1512,28 @@ /* Try next area on same PV if looking for contiguous space */ if (alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG) return NEXT_AREA; - - /* Cling_to_alloced? */ - if ((alloc_parms->flags & A_CLING_TO_ALLOCED) && - _check_cling_to_alloced(ah, pva, alloc_state)) - return PREFERRED; - /* Cling? */ - if (!(alloc_parms->flags & A_CLING_BY_TAGS) && - alloc_parms->prev_lvseg && _check_cling(ah, NULL, alloc_parms->prev_lvseg, pva, alloc_state)) + /* Cling to prev_lvseg? */ + if (((alloc_parms->flags & A_CLING_TO_LVSEG) || (ah->maximise_cling && alloc_parms->prev_lvseg)) && + _check_cling(ah, NULL, alloc_parms->prev_lvseg, pva, alloc_state)) /* If this PV is suitable, use this first area */ return PREFERRED; - if (!ah->maximise_cling && !(alloc_parms->flags & A_CLING_BY_TAGS)) - return NEXT_PV; + /* Cling_to_alloced? */ + if ((alloc_parms->flags & A_CLING_TO_ALLOCED) && + _check_cling_to_alloced(ah, NULL, pva, alloc_state)) + return PREFERRED; /* Cling_by_tags? */ - if ((alloc_parms->flags & (A_CLING_BY_TAGS | A_CLING_TO_ALLOCED)) && ah->cling_tag_list_cn && - alloc_parms->prev_lvseg && _check_cling(ah, ah->cling_tag_list_cn, alloc_parms->prev_lvseg, pva, alloc_state)) - return PREFERRED; - - if (alloc_parms->flags & A_CLING_BY_TAGS) + if (!(alloc_parms->flags & A_CLING_BY_TAGS) || !ah->cling_tag_list_cn) return NEXT_PV; + if (alloc_parms->prev_lvseg) { + if (_check_cling(ah, ah->cling_tag_list_cn, alloc_parms->prev_lvseg, pva, alloc_state)) + return PREFERRED; + } else if (_check_cling_to_alloced(ah, ah->cling_tag_list_cn, pva, alloc_state)) + return PREFERRED; + /* All areas on this PV give same result so pointless checking more */ return NEXT_PV; } @@ -1669,6 +1675,7 @@ uint32_t devices_needed = ah->area_count + ah->parity_count; /* ix_offset holds the number of parallel allocations that must be contiguous/cling */ + /* At most one of A_CONTIGUOUS_TO_LVSEG, A_CLING_TO_LVSEG or A_CLING_TO_ALLOCED may be set */ if (alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG)) ix_offset = _stripes_per_mimage(alloc_parms->prev_lvseg) * alloc_parms->prev_lvseg->area_count; @@ -1791,7 +1798,7 @@ break; } } while ((alloc_parms->alloc == ALLOC_ANYWHERE && last_ix != ix && ix < devices_needed + alloc_state->log_area_count_still_needed) || - /* With cling_to_alloced, if there were gaps in the preferred areas, have a second iteration */ + /* With cling_to_alloced and normal, if there were gaps in the preferred areas, have a second iteration */ (alloc_parms->alloc == ALLOC_NORMAL && preferred_count && (preferred_count < ix_offset || alloc_state->log_area_count_still_needed) && (alloc_parms->flags & A_CLING_TO_ALLOCED) && !iteration_count++) || @@ -1920,7 +1927,7 @@ return_0; /* - * If we didn't allocate anything this time and had + * If we didn't allocate anything this time with ALLOC_NORMAL and had * A_CLING_TO_ALLOCED set, try again without it. * * For ALLOC_NORMAL, if we did allocate something without the @@ -1928,7 +1935,7 @@ * remain on the same disks where possible. */ if (old_allocated == alloc_state->allocated) { - if (alloc_parms->flags & A_CLING_TO_ALLOCED) + if ((alloc_parms->alloc == ALLOC_NORMAL) && (alloc_parms->flags & A_CLING_TO_ALLOCED)) alloc_parms->flags &= ~A_CLING_TO_ALLOCED; else break; /* Give up */ --- LVM2/WHATS_NEW 2012/05/11 22:19:12 1.2403 +++ LVM2/WHATS_NEW 2012/05/11 22:53:13 1.2404 @@ -1,6 +1,8 @@ Version 2.02.96 - ================================ - Fix policy loop not to use later policies when --alloc cling without tags. + Fix alloc cling to cling to PVs already found with contiguous policy. + Fix cling policy not to behave like normal policy if no previous LV seg. + Fix allocation loop not to use later policies when --alloc cling without tags. Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags. Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92). Fix division by zero if PV with zero PE count is used during vgcfgrestore.
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-11 22:19:12 Modified files: . : WHATS_NEW lib/metadata : lv_manip.c Log message: Fix allocation policy loop so it doesn't continue beyond cling using later policies it shouldn't be using when --alloc cling is specified but no tags are defined. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2402&r2=1.2403 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.378&r2=1.379 --- LVM2/WHATS_NEW 2012/05/11 18:59:01 1.2402 +++ LVM2/WHATS_NEW 2012/05/11 22:19:12 1.2403 @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Fix policy loop not to use later policies when --alloc cling without tags. Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags. Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92). Fix division by zero if PV with zero PE count is used during vgcfgrestore. --- LVM2/lib/metadata/lv_manip.c 2012/05/11 18:59:01 1.378 +++ LVM2/lib/metadata/lv_manip.c 2012/05/11 22:19:12 1.379 @@ -2022,7 +2022,7 @@ ah->alloc = ALLOC_CLING_BY_TAGS; /* Attempt each defined allocation policy in turn */ - for (alloc = ALLOC_CONTIGUOUS; alloc < ALLOC_INHERIT; alloc++) { + for (alloc = ALLOC_CONTIGUOUS; alloc <= ah->alloc; alloc++) { /* Skip cling_by_tags if no list defined */ if (alloc == ALLOC_CLING_BY_TAGS && !ah->cling_tag_list_cn) continue; @@ -2039,7 +2039,7 @@ if (!_find_max_parallel_space_for_one_policy(ah, &alloc_parms, pvms, &alloc_state)) goto_out; - if ((alloc_state.allocated == ah->new_extents && !alloc_state.log_area_count_still_needed) || (ah->alloc == alloc) || + if ((alloc_state.allocated == ah->new_extents && !alloc_state.log_area_count_still_needed) || (!can_split && (alloc_state.allocated != old_allocated))) break; } @@ -2154,7 +2154,7 @@ return NULL; } - if (alloc == ALLOC_INHERIT) + if (alloc >= ALLOC_INHERIT) alloc = vg->alloc; new_extents = (lv ? lv->le_count : 0) + extents;
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-11 18:59:02 Modified files: . : WHATS_NEW lib/metadata : lv_manip.c Log message: Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags. Remove some unnecesary prev_lvseg checks. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2401&r2=1.2402 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.377&r2=1.378 --- LVM2/WHATS_NEW 2012/05/10 08:54:33 1.2401 +++ LVM2/WHATS_NEW 2012/05/11 18:59:01 1.2402 @@ -1,5 +1,6 @@ Version 2.02.96 - ================================ + Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags. Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92). Fix division by zero if PV with zero PE count is used during vgcfgrestore. Add initial support for thin pool lvconvert. --- LVM2/lib/metadata/lv_manip.c 2012/05/11 15:32:19 1.377 +++ LVM2/lib/metadata/lv_manip.c 2012/05/11 18:59:01 1.378 @@ -39,10 +39,12 @@ #define RAID_METADATA_AREA_LEN 1 /* FIXME These ended up getting used differently from first intended. Refactor. */ -#define A_CONTIGUOUS 0x01 -#define A_CLING 0x02 -#define A_CLING_BY_TAGS 0x04 -#define A_CLING_TO_ALLOCED 0x08 /* Only for ALLOC_NORMAL */ +/* Only one of A_CONTIGUOUS_TO_LVSEG, A_CLING_TO_LVSEG, A_CLING_TO_ALLOCED may be set */ +#define A_CONTIGUOUS_TO_LVSEG 0x01 /* Must be contiguous to an existing segment */ +#define A_CLING_TO_LVSEG 0x02 /* Must use same disks as existing LV segment */ +#define A_CLING_TO_ALLOCED 0x04 /* Must use same disks as already-allocated segment */ + +#define A_CLING_BY_TAGS 0x08 /* Must match tags against existing segment */ #define A_CAN_SPLIT 0x10 /* @@ -907,11 +909,11 @@ /* Are there any preceding segments we must follow on from? */ if (alloc_parms->prev_lvseg) { if (alloc_parms->alloc == ALLOC_CONTIGUOUS) - alloc_parms->flags |= A_CONTIGUOUS; + alloc_parms->flags |= A_CONTIGUOUS_TO_LVSEG; else if (alloc_parms->alloc == ALLOC_CLING) - alloc_parms->flags |= A_CLING; + alloc_parms->flags |= A_CLING_TO_LVSEG; else if (alloc_parms->alloc == ALLOC_CLING_BY_TAGS) { - alloc_parms->flags |= A_CLING; + alloc_parms->flags |= A_CLING_TO_LVSEG; alloc_parms->flags |= A_CLING_BY_TAGS; } } @@ -1494,14 +1496,14 @@ return NEXT_AREA; /* If maximise_cling is set, perform several checks, otherwise perform exactly one. */ - if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS | A_CLING | A_CLING_TO_ALLOCED)) { + if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG | A_CLING_TO_ALLOCED)) { /* Contiguous? */ - if (((alloc_parms->flags & A_CONTIGUOUS) || ah->maximise_cling) && - alloc_parms->prev_lvseg && _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state)) + if (((alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG) || (ah->maximise_cling && alloc_parms->prev_lvseg)) && + _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state)) return PREFERRED; /* Try next area on same PV if looking for contiguous space */ - if (alloc_parms->flags & A_CONTIGUOUS) + if (alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG) return NEXT_AREA; /* Cling_to_alloced? */ @@ -1667,7 +1669,7 @@ uint32_t devices_needed = ah->area_count + ah->parity_count; /* ix_offset holds the number of parallel allocations that must be contiguous/cling */ - if (alloc_parms->flags & (A_CONTIGUOUS | A_CLING) && alloc_parms->prev_lvseg) + if (alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG)) ix_offset = _stripes_per_mimage(alloc_parms->prev_lvseg) * alloc_parms->prev_lvseg->area_count; if (alloc_parms->flags & A_CLING_TO_ALLOCED)
CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2012-05-11 15:32:19 Modified files: lib/metadata : lv_manip.c Log message: Always include debug mesg when cling to allocated is set. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.376&r2=1.377 --- LVM2/lib/metadata/lv_manip.c 2012/05/11 15:26:30 1.376 +++ LVM2/lib/metadata/lv_manip.c 2012/05/11 15:32:19 1.377 @@ -1673,7 +1673,7 @@ if (alloc_parms->flags & A_CLING_TO_ALLOCED) ix_offset = ah->area_count; - if (alloc_parms->alloc == ALLOC_NORMAL) + if (alloc_parms->alloc == ALLOC_NORMAL || (alloc_parms->flags & A_CLING_TO_ALLOCED)) log_debug("Cling_to_allocated is %sset", alloc_parms->flags & A_CLING_TO_ALLOCED ? "" : "not ");