Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
List overview
Download
lvm2-commits
September 2019
----- 2024 -----
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
lvm2-commits@lists.fedorahosted.org
6 participants
90 discussions
Start a n
N
ew thread
stable-2.02 - build: make generate
by Marian Csontos
24 Sep '19
24 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=444dedea2355b42000f60…
Commit: 444dedea2355b42000f60b4ca0eb4a2f027123aa Parent: 92f1c888e0881f3defb4d0220d89f6225be70f7d Author: Marian Csontos <mcsontos(a)redhat.com> AuthorDate: Tue Sep 24 10:38:22 2019 +0200 Committer: Marian Csontos <mcsontos(a)redhat.com> CommitterDate: Tue Sep 24 10:38:22 2019 +0200 build: make generate --- man/lvchange.8_pregen | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/man/lvchange.8_pregen b/man/lvchange.8_pregen index 26a6297..5c3b6e5 100644 --- a/man/lvchange.8_pregen +++ b/man/lvchange.8_pregen @@ -340,7 +340,9 @@ required, after which the others are optional. .br - -Resyncronize a mirror or raid LV. +Resyncronize a mirror or raid LV. +.br +Use to reset 'R' attribute on a not initially synchronized LV. .br .P \fBlvchange\fP \fB--resync\fP \fIVG\fP|\fILV\fP\fI_mirror_raid\fP|\fITag\fP|\fISelect\fP ...
1
0
0
0
stable-2.02 - lvmetad: Fix function prototype when not configured
by Marian Csontos
24 Sep '19
24 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92f1c888e0881f3defb4d…
Commit: 92f1c888e0881f3defb4d0220d89f6225be70f7d Parent: a57b92dec396ac79c57e02e54c04e205aa85f084 Author: Marian Csontos <mcsontos(a)redhat.com> AuthorDate: Tue Sep 24 10:34:44 2019 +0200 Committer: Marian Csontos <mcsontos(a)redhat.com> CommitterDate: Tue Sep 24 10:34:44 2019 +0200 lvmetad: Fix function prototype when not configured Fixes: 6b129308 --- lib/cache/lvmetad.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/cache/lvmetad.h b/lib/cache/lvmetad.h index 55ce16a..ebc3365 100644 --- a/lib/cache/lvmetad.h +++ b/lib/cache/lvmetad.h @@ -196,7 +196,7 @@ static inline int lvmetad_pvscan_single(struct cmd_context *cmd, struct device * struct dm_list *found_vgnames, struct dm_list *changed_vgnames) {return 0;} -static inline int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) {return 0;} +static inline int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait, struct dm_list *found_vgnames) {return 0;} static inline int lvmetad_vg_clear_outdated_pvs(struct volume_group *vg) {return 0;} static inline void lvmetad_validate_global_cache(struct cmd_context *cmd, int force) {}
1
0
0
0
stable-2.02 - vgcreate/vgextend: restrict PVs with mixed block sizes
by Marian Csontos
24 Sep '19
24 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a57b92dec396ac79c57e0…
Commit: a57b92dec396ac79c57e02e54c04e205aa85f084 Parent: 8d3e01ff4f94a8d36b16520a5e402dbc7539dd2c Author: David Teigland <teigland(a)redhat.com> AuthorDate: Thu Aug 1 10:06:47 2019 -0500 Committer: Marian Csontos <mcsontos(a)redhat.com> CommitterDate: Tue Sep 24 10:14:30 2019 +0200 vgcreate/vgextend: restrict PVs with mixed block sizes Avoid having PVs with different logical block sizes in the same VG. This prevents LVs from having mixed block sizes, which can produce file system errors. The new config setting devices/allow_mixed_block_sizes (default 0) can be changed to 1 to return to the unrestricted mode. (cherry picked from commit 0404539edb25e4a9d3456bb3e6b402aa2767af6b) Conflicts: tools/lvmcmdline.c tools/toollib.c --- lib/commands/toolcontext.h | 1 + lib/config/config_settings.h | 5 ++++ lib/metadata/metadata-exported.h | 1 + lib/metadata/metadata.c | 44 +++++++++++++++++++++++++++++++++++ tools/lvmcmdline.c | 2 + tools/toollib.c | 47 ++++++++++++++++++++++++++++++++++++++ tools/vgcreate.c | 2 + 7 files changed, 102 insertions(+), 0 deletions(-) diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index 4b2a079..497f4bd 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -155,6 +155,7 @@ struct cmd_context { unsigned include_shared_vgs:1; /* report/display cmds can reveal lockd VGs */ unsigned include_active_foreign_vgs:1; /* cmd should process foreign VGs with active LVs */ unsigned vg_read_print_access_error:1; /* print access errors from vg_read */ + unsigned allow_mixed_block_sizes:1; unsigned force_access_clustered:1; unsigned lockd_gl_disable:1; unsigned lockd_vg_disable:1; diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h index 0e81252..7981d5d 100644 --- a/lib/config/config_settings.h +++ b/lib/config/config_settings.h @@ -470,6 +470,11 @@ cfg(devices_allow_changes_with_duplicate_pvs_CFG, "allow_changes_with_duplicate_ "Enabling this setting allows the VG to be used as usual even with\n" "uncertain devices.\n") +cfg(devices_allow_mixed_block_sizes_CFG, "allow_mixed_block_sizes", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(2, 3, 6), NULL, 0, NULL, + "Allow PVs in the same VG with different logical block sizes.\n" + "When allowed, the user is responsible to ensure that an LV is\n" + "using PVs with matching block sizes when necessary.\n") + cfg_array(allocation_cling_tag_list_CFG, "cling_tag_list", allocation_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 77), NULL, 0, NULL, "Advise LVM which PVs to use when searching for new space.\n" "When searching for free space to extend an LV, the 'cling' allocation\n" diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 75caba1..9c24132 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -591,6 +591,7 @@ struct pvcreate_params { unsigned is_remove : 1; /* is removing PVs, not creating */ unsigned preserve_existing : 1; unsigned check_failed : 1; + unsigned check_consistent_block_size : 1; }; struct lvresize_params { diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index cb38f66..81a6029 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -699,12 +699,40 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp) { struct pv_list *pvl; unsigned int max_phys_block_size = 0; + unsigned int physical_block_size, logical_block_size; + unsigned int prev_lbs = 0; + int inconsistent_existing_lbs = 0; log_debug_metadata("Adding PVs to VG %s.", vg->name); if (vg_bad_status_bits(vg, RESIZEABLE_VG)) return_0; + /* + * Check if existing PVs have inconsistent block sizes. + * If so, do not enforce new devices to be consistent. + */ + dm_list_iterate_items(pvl, &vg->pvs) { + logical_block_size = 0; + physical_block_size = 0; + + if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size)) + continue; + + if (!logical_block_size) + continue; + + if (!prev_lbs) { + prev_lbs = logical_block_size; + continue; + } + + if (prev_lbs != logical_block_size) { + inconsistent_existing_lbs = 1; + break; + } + } + dm_list_iterate_items(pvl, &pp->pvs) { log_debug_metadata("Adding PV %s to VG %s.", pv_dev_name(pvl->pv), vg->name); @@ -715,6 +743,22 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp) return 0; } + logical_block_size = 0; + physical_block_size = 0; + + if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size)) + log_warn("WARNING: PV %s has unknown block size.", pv_dev_name(pvl->pv)); + + else if (prev_lbs && logical_block_size && (logical_block_size != prev_lbs)) { + if (vg->cmd->allow_mixed_block_sizes || inconsistent_existing_lbs) + log_debug("Devices have inconsistent block sizes (%u and %u)", prev_lbs, logical_block_size); + else { + log_error("Devices have inconsistent logical block sizes (%u and %u).", + prev_lbs, logical_block_size); + return 0; + } + } + if (!add_pv_to_vg(vg, pv_dev_name(pvl->pv), pvl->pv, 0)) { log_error("PV %s cannot be added to VG %s.", pv_dev_name(pvl->pv), vg->name); diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 6a1ab11..9c39f48 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -2306,6 +2306,8 @@ static int _get_current_settings(struct cmd_context *cmd) if (cmd->cname->flags & CAN_USE_ONE_SCAN) cmd->can_use_one_scan = 1; + cmd->allow_mixed_block_sizes = find_config_tree_bool(cmd, devices_allow_mixed_block_sizes_CFG, NULL); + cmd->partial_activation = 0; cmd->degraded_activation = 0; activation_mode = find_config_tree_str(cmd, activation_mode_CFG, NULL); diff --git a/tools/toollib.c b/tools/toollib.c index 1b01ccc..42179d9 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -5481,6 +5481,8 @@ int pvcreate_each_device(struct cmd_context *cmd, struct device_list *devl; const char *pv_name; int consistent = 0; + unsigned int physical_block_size, logical_block_size; + unsigned int prev_pbs = 0, prev_lbs = 0; int must_use_all = (cmd->cname->flags & MUST_USE_ALL_ARGS); int found; unsigned i; @@ -5559,6 +5561,51 @@ int pvcreate_each_device(struct cmd_context *cmd, pd->dev = dev_cache_get(pd->name, cmd->full_filter); /* + * Check for consistent block sizes. + */ + if (pp->check_consistent_block_size) { + dm_list_iterate_items(pd, &pp->arg_devices) { + if (!pd->dev) + continue; + + logical_block_size = 0; + physical_block_size = 0; + + if (!dev_get_direct_block_sizes(pd->dev, &physical_block_size, &logical_block_size)) { + log_warn("WARNING: Unknown block size for device %s.", dev_name(pd->dev)); + continue; + } + + if (!logical_block_size) { + log_warn("WARNING: Unknown logical_block_size for device %s.", dev_name(pd->dev)); + continue; + } + + if (!prev_lbs) { + prev_lbs = logical_block_size; + prev_pbs = physical_block_size; + continue; + } + + if (prev_lbs == logical_block_size) { + /* Require lbs to match, just warn about unmatching pbs. */ + if (!cmd->allow_mixed_block_sizes && prev_pbs && physical_block_size && + (prev_pbs != physical_block_size)) + log_warn("WARNING: Devices have inconsistent physical block sizes (%u and %u).", + prev_pbs, physical_block_size); + continue; + } + + if (!cmd->allow_mixed_block_sizes) { + log_error("Devices have inconsistent logical block sizes (%u and %u).", + prev_lbs, logical_block_size); + log_print("See lvm.conf allow_mixed_block_sizes."); + return 0; + } + } + } + + /* * Use process_each_pv to search all existing PVs and devices. * * This is a slightly different way to use process_each_pv, because the diff --git a/tools/vgcreate.c b/tools/vgcreate.c index 4356d99..7add53b 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -48,6 +48,8 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) /* Don't create a new PV on top of an existing PV like pvcreate does. */ pp.preserve_existing = 1; + pp.check_consistent_block_size = 1; + if (!vgcreate_params_set_defaults(cmd, &vp_def, NULL)) return EINVALID_CMD_LINE; vp_def.vg_name = vg_name;
1
0
0
0
master - tests: add writecache-split
by David Teigland
23 Sep '19
23 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e35cf0f623ba591c12a1a…
Commit: e35cf0f623ba591c12a1a2eaed126d47bf11103c Parent: 4fe4c30e7a29017e11de867b7f0d65524f283c1a Author: David Teigland <teigland(a)redhat.com> AuthorDate: Mon Sep 23 14:37:46 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Mon Sep 23 16:35:01 2019 -0500 tests: add writecache-split --- test/shell/writecache-split.sh | 128 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 128 insertions(+), 0 deletions(-) diff --git a/test/shell/writecache-split.sh b/test/shell/writecache-split.sh new file mode 100644 index 0000000..b28cec9 --- /dev/null +++ b/test/shell/writecache-split.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash + +# Copyright (C) 2018 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# Test single lv cache options + +SKIP_WITH_LVMPOLLD=1 + +. lib/inittest + +mkfs_mount_umount() +{ + lvt=$1 + + lvchange -ay $vg/$lvt + + mkfs.xfs -f -s size=4096 "$DM_DEV_DIR/$vg/$lvt" + mount "$DM_DEV_DIR/$vg/$lvt" "$mount_dir" + cp pattern1 "$mount_dir/pattern1" + dd if=/dev/zero of="$mount_dir/zeros2M" bs=1M count=32 conv=fdatasync + umount "$mount_dir" + + lvchange -an $vg/$lvt +} + +mount_umount() +{ + lvt=$1 + + lvchange -ay $vg/$lvt + + mount "$DM_DEV_DIR/$vg/$lvt" "$mount_dir" + diff pattern1 "$mount_dir/pattern1" + dd if="$mount_dir/zeros2M" of=/dev/null bs=1M count=32 + umount "$mount_dir" + + lvchange -an $vg/$lvt +} + +aux have_cache 1 10 0 || skip +which mkfs.xfs || skip + +mount_dir="mnt" +mkdir -p "$mount_dir" + +# generate random data +dd if=/dev/urandom of=pattern1 bs=512K count=1 + +aux prepare_devs 4 + +vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" + +lvcreate -n $lv1 -l 16 -an $vg "$dev1" "$dev4" +lvcreate -n $lv2 -l 4 -an $vg "$dev2" + +# +# split when no devs are missing +# + +lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1 + +mkfs_mount_umount $lv1 + +lvconvert --splitcache $vg/$lv1 +lvs -o segtype $vg/$lv1 | grep linear +lvs -o segtype $vg/$lv2 | grep linear + +mount_umount $lv1 + +# +# split while cachevol is missing +# + +lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1 + +mkfs_mount_umount $lv1 + +aux disable_dev "$dev2" + +not lvconvert --splitcache $vg/$lv1 +lvconvert --splitcache --force --yes $vg/$lv1 + +lvs -o segtype $vg/$lv1 | grep linear + +aux enable_dev "$dev2" +lvs -o segtype $vg/$lv2 | grep linear + +vgck --updatemetadata $vg +lvs $vg +vgchange -an $vg +vgextend --restoremissing $vg "$dev2" + + +# +# split while cachevol has 1 of 2 PVs +# + +lvremove $vg/$lv2 +lvcreate -n $lv2 -l 14 -an $vg "$dev2" "$dev3" + +lvconvert -y --type writecache --cachevol $lv2 $vg/$lv1 + +mkfs_mount_umount $lv1 + +aux disable_dev "$dev3" + +not lvconvert --splitcache $vg/$lv1 +lvconvert --splitcache --force --yes $vg/$lv1 + +lvs -o segtype $vg/$lv1 | grep linear + +aux enable_dev "$dev3" +lvs -o segtype $vg/$lv2 | grep linear + +vgck --updatemetadata $vg +lvs $vg +vgchange -an $vg +vgextend --restoremissing $vg "$dev3" + +vgremove -ff $vg
1
0
0
0
master - lvconvert: allow --cache shortcut for --type cache with cachevol
by David Teigland
23 Sep '19
23 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4fe4c30e7a29017e11de8…
Commit: 4fe4c30e7a29017e11de867b7f0d65524f283c1a Parent: a353bfdd9f5f612967e514240b8c4cb06d924a19 Author: David Teigland <teigland(a)redhat.com> AuthorDate: Mon Sep 23 11:07:12 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Mon Sep 23 14:21:09 2019 -0500 lvconvert: allow --cache shortcut for --type cache with cachevol --- tools/command-lines.in | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/tools/command-lines.in b/tools/command-lines.in index 65221c0..7be4715 100644 --- a/tools/command-lines.in +++ b/tools/command-lines.in @@ -482,6 +482,14 @@ ID: lvconvert_to_cache_with_cachevol DESC: Attach a cache to an LV, converts the LV to type cache. RULE: all and lv_is_visible +# alternate form of lvconvert --type cache +lvconvert --cache --cachevol LV LV_linear_striped_raid_thinpool +OO: OO_LVCONVERT_CACHE, OO_LVCONVERT, --poolmetadatasize SizeMB, --chunksize SizeKB +ID: lvconvert_to_cache_with_cachevol +DESC: Attach a cache to an LV, converts the LV to type cache. +RULE: all and lv_is_visible +FLAGS: SECONDARY_SYNTAX + --- lvconvert --type thin-pool LV_linear_striped_raid_cache
1
0
0
0
master - tests: update cache-single-split
by David Teigland
23 Sep '19
23 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a353bfdd9f5f612967e51…
Commit: a353bfdd9f5f612967e514240b8c4cb06d924a19 Parent: 5191057d9df3e5b92db3f80c412b99aea1074358 Author: David Teigland <teigland(a)redhat.com> AuthorDate: Mon Sep 23 14:20:01 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Mon Sep 23 14:21:09 2019 -0500 tests: update cache-single-split enable splitting while LV is active which works again since the cvol suffix was dropped. --- test/shell/cache-single-split.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/shell/cache-single-split.sh b/test/shell/cache-single-split.sh index edfa087..90c3ddb 100644 --- a/test/shell/cache-single-split.sh +++ b/test/shell/cache-single-split.sh @@ -113,7 +113,7 @@ check lv_field $vg/$lv1 cachemode "writethrough" mkfs_mount_umount $lv1 -# lvchange -ay $vg/$lv1 +lvchange -ay $vg/$lv1 lvconvert --splitcache $vg/$lv1 lvs -o segtype $vg/$lv1 | grep linear @@ -135,7 +135,7 @@ lvchange -an $vg/$lv2 mkfs_mount_umount $lv1 -# lvchange -ay $vg/$lv1 +lvchange -ay $vg/$lv1 lvconvert --splitcache $vg/$lv1 lvs -o segtype $vg/$lv1 | grep linear @@ -160,7 +160,7 @@ lvchange -an $vg/$lv2 mkfs_mount_umount $lv1 -# lvchange -ay $vg/$lv1 +lvchange -ay $vg/$lv1 aux disable_dev "$dev2"
1
0
0
0
master - drop cvol dm uuid suffix for cachevol LVs
by David Teigland
23 Sep '19
23 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5191057d9df3e5b92db3f…
Commit: 5191057d9df3e5b92db3f80c412b99aea1074358 Parent: 338a60bb417e413820a6d1faeed864222607c8ef Author: David Teigland <teigland(a)redhat.com> AuthorDate: Mon Sep 23 14:10:56 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Mon Sep 23 14:13:31 2019 -0500 drop cvol dm uuid suffix for cachevol LVs The "-cvol" suffix on the uuid is interfering with activation code, so drop the suffix for now. --- lib/activate/dev_manager.c | 2 +- lib/misc/lvm-string.c | 2 -- lib/writecache/writecache.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index b85237d..32e795d 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -46,7 +46,7 @@ typedef enum { } action_t; /* This list must match lib/misc/lvm-string.c:build_dm_uuid(). */ -const char *uuid_suffix_list[] = { "pool", "cdata", "cmeta", "tdata", "tmeta", "vdata", "vpool", "cvol", NULL}; +const char *uuid_suffix_list[] = { "pool", "cdata", "cmeta", "tdata", "tmeta", "vdata", "vpool", NULL}; struct dlid_list { struct dm_list list; diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c index 4034b40..bb66214 100644 --- a/lib/misc/lvm-string.c +++ b/lib/misc/lvm-string.c @@ -157,7 +157,6 @@ static const char *_lvname_has_reserved_component_string(const char *lvname) "_cdata", "_cmeta", "_corig", - "_cvol", "_wcorig", "_mimage", "_mlog", @@ -254,7 +253,6 @@ char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv, (lv_is_cache(lv) && lv_is_pending_delete(lv)) ? "real" : lv_is_cache_pool_data(lv) ? "cdata" : lv_is_cache_pool_metadata(lv) ? "cmeta" : - lv_is_cache_vol(lv) ? "cvol" : // FIXME: dm-tree needs fixes for mirrors/raids //lv_is_mirror_image(lv) ? "mimage" : //lv_is_mirror_log(lv) ? "mlog" : diff --git a/lib/writecache/writecache.c b/lib/writecache/writecache.c index 0a5b485..07a2d63 100644 --- a/lib/writecache/writecache.c +++ b/lib/writecache/writecache.c @@ -263,7 +263,7 @@ static int _writecache_add_target_line(struct dev_manager *dm, if (!(origin_uuid = build_dm_uuid(mem, seg_lv(seg, 0), "real"))) return_0; - if (!(fast_uuid = build_dm_uuid(mem, seg->writecache, "cvol"))) + if (!(fast_uuid = build_dm_uuid(mem, seg->writecache, NULL))) return_0; if (!dm_tree_node_add_writecache_target(node, len,
1
0
0
0
master - tests: update cache-single-split
by David Teigland
20 Sep '19
20 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=338a60bb417e413820a6d…
Commit: 338a60bb417e413820a6d1faeed864222607c8ef Parent: 27c3c1d7c8dcb160f29d1610f3993f41afc72a6d Author: David Teigland <teigland(a)redhat.com> AuthorDate: Fri Sep 20 16:33:35 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Fri Sep 20 16:36:14 2019 -0500 tests: update cache-single-split the new use of uuid suffixes on internal dm devs has impacted splitting when an LV is active, so temporarily disable that until fixed. --- test/shell/cache-single-split.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/shell/cache-single-split.sh b/test/shell/cache-single-split.sh index 90c3ddb..edfa087 100644 --- a/test/shell/cache-single-split.sh +++ b/test/shell/cache-single-split.sh @@ -113,7 +113,7 @@ check lv_field $vg/$lv1 cachemode "writethrough" mkfs_mount_umount $lv1 -lvchange -ay $vg/$lv1 +# lvchange -ay $vg/$lv1 lvconvert --splitcache $vg/$lv1 lvs -o segtype $vg/$lv1 | grep linear @@ -135,7 +135,7 @@ lvchange -an $vg/$lv2 mkfs_mount_umount $lv1 -lvchange -ay $vg/$lv1 +# lvchange -ay $vg/$lv1 lvconvert --splitcache $vg/$lv1 lvs -o segtype $vg/$lv1 | grep linear @@ -160,7 +160,7 @@ lvchange -an $vg/$lv2 mkfs_mount_umount $lv1 -lvchange -ay $vg/$lv1 +# lvchange -ay $vg/$lv1 aux disable_dev "$dev2"
1
0
0
0
master - writecache: display layout and role fields
by David Teigland
20 Sep '19
20 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=27c3c1d7c8dcb160f29d1…
Commit: 27c3c1d7c8dcb160f29d1610f3993f41afc72a6d Parent: 6f7d7089b4527cd1e198bac9da0341d8f65d4717 Author: David Teigland <teigland(a)redhat.com> AuthorDate: Fri Sep 20 14:54:00 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Fri Sep 20 14:55:11 2019 -0500 writecache: display layout and role fields --- lib/metadata/lv_manip.c | 33 ++++++++++++++++++++++++++++++--- lib/metadata/metadata-exported.h | 1 + lib/metadata/metadata.c | 13 +++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 107074a..79e3d15 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -131,7 +131,10 @@ enum { LV_TYPE_RAID6_NR, LV_TYPE_RAID6_NC, LV_TYPE_LOCKD, - LV_TYPE_SANLOCK + LV_TYPE_SANLOCK, + LV_TYPE_CACHEVOL, + LV_TYPE_WRITECACHE, + LV_TYPE_WRITECACHEORIGIN }; static const char *_lv_type_names[] = { @@ -184,6 +187,9 @@ static const char *_lv_type_names[] = { [LV_TYPE_RAID6_NC] = SEG_TYPE_NAME_RAID6_NC, [LV_TYPE_LOCKD] = "lockd", [LV_TYPE_SANLOCK] = "sanlock", + [LV_TYPE_CACHEVOL] = "cachevol", + [LV_TYPE_WRITECACHE] = "writecache", + [LV_TYPE_WRITECACHEORIGIN] = "writecacheorigin", }; static int _lv_layout_and_role_mirror(struct dm_pool *mem, @@ -410,6 +416,14 @@ static int _lv_layout_and_role_cache(struct dm_pool *mem, if (lv_is_cache(lv) && !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHE])) goto_bad; + } else if (lv_is_writecache_origin(lv)) { + if (!str_list_add(mem, role, _lv_type_names[LV_TYPE_WRITECACHE]) || + !str_list_add(mem, role, _lv_type_names[LV_TYPE_ORIGIN]) || + !str_list_add_no_dup_check(mem, role, _lv_type_names[LV_TYPE_WRITECACHEORIGIN])) + goto_bad; + if (lv_is_writecache(lv) && + !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_WRITECACHE])) + goto_bad; } else top_level = 1; @@ -422,7 +436,20 @@ static int _lv_layout_and_role_cache(struct dm_pool *mem, if (lv_is_cache(lv) && !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHE])) goto_bad; - else if (lv_is_cache_pool(lv) || lv_is_cache_vol(lv)) { + else if (lv_is_writecache(lv) && + !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_WRITECACHE])) + goto_bad; + else if (lv_is_writecache_cachevol(lv)) { + if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_WRITECACHE]) || + !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHEVOL])) + goto_bad; + *public_lv = 0; + } else if (lv_is_cache_vol(lv)) { + if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHE]) || + !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHEVOL])) + goto_bad; + *public_lv = 0; + } else if (lv_is_cache_pool(lv)) { if (!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_CACHE]) || !str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_POOL])) goto_bad; @@ -546,7 +573,7 @@ int lv_layout_and_role(struct dm_pool *mem, const struct logical_volume *lv, goto_bad; /* Caches and related */ - if ((lv_is_cache_type(lv) || lv_is_cache_origin(lv)) && + if ((lv_is_cache_type(lv) || lv_is_cache_origin(lv) || lv_is_writecache(lv) || lv_is_writecache_origin(lv)) && !_lv_layout_and_role_cache(mem, lv, *layout, *role, &public_lv)) goto_bad; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 63d3fad..7c9aebb 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -1081,6 +1081,7 @@ int lv_is_cow(const struct logical_volume *lv); int lv_is_cache_origin(const struct logical_volume *lv); int lv_is_writecache_origin(const struct logical_volume *lv); +int lv_is_writecache_cachevol(const struct logical_volume *lv); int lv_is_merging_cow(const struct logical_volume *cow); uint32_t cow_max_extents(const struct logical_volume *origin, uint32_t chunk_size); diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index dc88d87..644cd59 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -5180,3 +5180,16 @@ int lv_is_writecache_origin(const struct logical_volume *lv) return 0; } +int lv_is_writecache_cachevol(const struct logical_volume *lv) +{ + struct seg_list *sl; + + dm_list_iterate_items(sl, &lv->segs_using_this_lv) { + if (!sl->seg || !sl->seg->lv || !sl->seg->writecache) + continue; + if (lv_is_writecache(sl->seg->lv) && (sl->seg->writecache == lv)) + return 1; + } + return 0; +} +
1
0
0
0
master - writecache: use dm suffixes and lv attributes
by David Teigland
20 Sep '19
20 Sep '19
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6f7d7089b4527cd1e198b…
Commit: 6f7d7089b4527cd1e198bac9da0341d8f65d4717 Parent: 6f355c673631b0d7959191c8a56a577b3a0e97c9 Author: David Teigland <teigland(a)redhat.com> AuthorDate: Fri Sep 20 14:04:18 2019 -0500 Committer: David Teigland <teigland(a)redhat.com> CommitterDate: Fri Sep 20 14:08:51 2019 -0500 writecache: use dm suffixes and lv attributes - use internal CACHE_VOL flag on cachevol LV - add suffixes to dm uuids for internal LVs - display appropriate letters in the LV attr field - display writecache's cachevol in lvs output --- lib/metadata/lv.c | 12 ++++++++++-- lib/metadata/metadata-exported.h | 24 ++++++++++++++---------- lib/metadata/metadata.c | 14 ++++++++++++++ lib/misc/lvm-string.c | 2 ++ lib/writecache/writecache.c | 4 ++-- tools/lvconvert.c | 4 ++++ 6 files changed, 46 insertions(+), 14 deletions(-) diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c index b4ed712..4c2ab2b 100644 --- a/lib/metadata/lv.c +++ b/lib/metadata/lv.c @@ -716,6 +716,9 @@ struct logical_volume *lv_pool_lv(const struct logical_volume *lv) if (lv_is_vdo(lv)) return seg_lv(first_seg(lv), 0); + if (lv_is_writecache(lv)) + return first_seg(lv)->writecache; + return NULL; } @@ -1235,7 +1238,7 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_ repstr[0] = 'l'; else if (lv_is_cow(lv)) repstr[0] = (lv_is_merging_cow(lv)) ? 'S' : 's'; - else if (lv_is_cache_origin(lv)) + else if (lv_is_cache_origin(lv) || lv_is_writecache_origin(lv)) repstr[0] = 'o'; else repstr[0] = '-'; @@ -1314,7 +1317,12 @@ char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_ if (lv_is_thin_pool(lv) || lv_is_thin_volume(lv)) repstr[6] = 't'; - else if (lv_is_cache_pool(lv) || lv_is_cache_vol(lv) || lv_is_cache(lv) || lv_is_cache_origin(lv)) + else if (lv_is_cache_pool(lv) || + lv_is_cache_vol(lv) || + lv_is_cache(lv) || + lv_is_cache_origin(lv) || + lv_is_writecache(lv) || + lv_is_writecache_origin(lv)) repstr[6] = 'C'; else if (lv_is_raid_type(lv)) repstr[6] = 'r'; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 1c10390..63d3fad 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -269,16 +269,19 @@ #define lv_is_removed(lv) (((lv)->status & LV_REMOVED) ? 1 : 0) /* Recognize component LV (matching lib/misc/lvm-string.c _lvname_has_reserved_component_string()) */ -#define lv_is_component(lv) (lv_is_cache_origin(lv) || ((lv)->status & (\ - CACHE_POOL_DATA |\ - CACHE_POOL_METADATA |\ - LV_VDO_POOL_DATA |\ - MIRROR_IMAGE |\ - MIRROR_LOG |\ - RAID_IMAGE |\ - RAID_META |\ - THIN_POOL_DATA |\ - THIN_POOL_METADATA)) ? 1 : 0) +#define lv_is_component(lv) (lv_is_cache_origin(lv) || \ + lv_is_writecache_origin(lv) || \ + ((lv)->status & (\ + CACHE_POOL_DATA |\ + CACHE_POOL_METADATA |\ + LV_CACHE_VOL |\ + LV_VDO_POOL_DATA |\ + MIRROR_IMAGE |\ + MIRROR_LOG |\ + RAID_IMAGE |\ + RAID_META |\ + THIN_POOL_DATA |\ + THIN_POOL_METADATA)) ? 1 : 0) int lv_layout_and_role(struct dm_pool *mem, const struct logical_volume *lv, struct dm_list **layout, struct dm_list **role); @@ -1077,6 +1080,7 @@ int lv_is_cow(const struct logical_volume *lv); #define lv_is_thick_snapshot lv_is_cow int lv_is_cache_origin(const struct logical_volume *lv); +int lv_is_writecache_origin(const struct logical_volume *lv); int lv_is_merging_cow(const struct logical_volume *cow); uint32_t cow_max_extents(const struct logical_volume *origin, uint32_t chunk_size); diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index b434967..dc88d87 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -5166,3 +5166,17 @@ struct volume_group *vg_read_for_update(struct cmd_context *cmd, const char *vg_ return vg; } + +int lv_is_writecache_origin(const struct logical_volume *lv) +{ + struct seg_list *sl; + + dm_list_iterate_items(sl, &lv->segs_using_this_lv) { + if (!sl->seg || !sl->seg->lv || !sl->seg->origin) + continue; + if (lv_is_writecache(sl->seg->lv) && (sl->seg->origin == lv)) + return 1; + } + return 0; +} + diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c index b7c1c12..4034b40 100644 --- a/lib/misc/lvm-string.c +++ b/lib/misc/lvm-string.c @@ -158,6 +158,7 @@ static const char *_lvname_has_reserved_component_string(const char *lvname) "_cmeta", "_corig", "_cvol", + "_wcorig", "_mimage", "_mlog", "_rimage", @@ -249,6 +250,7 @@ char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv, */ /* Suffixes used here MUST match lib/activate/dev_manager.c */ layer = lv_is_cache_origin(lv) ? "real" : + lv_is_writecache_origin(lv) ? "real" : (lv_is_cache(lv) && lv_is_pending_delete(lv)) ? "real" : lv_is_cache_pool_data(lv) ? "cdata" : lv_is_cache_pool_metadata(lv) ? "cmeta" : diff --git a/lib/writecache/writecache.c b/lib/writecache/writecache.c index 53619c3..0a5b485 100644 --- a/lib/writecache/writecache.c +++ b/lib/writecache/writecache.c @@ -260,10 +260,10 @@ static int _writecache_add_target_line(struct dev_manager *dm, if ((pmem = lv_on_pmem(seg->writecache)) < 0) return_0; - if (!(origin_uuid = build_dm_uuid(mem, seg_lv(seg, 0), NULL))) + if (!(origin_uuid = build_dm_uuid(mem, seg_lv(seg, 0), "real"))) return_0; - if (!(fast_uuid = build_dm_uuid(mem, seg->writecache, NULL))) + if (!(fast_uuid = build_dm_uuid(mem, seg->writecache, "cvol"))) return_0; if (!dm_tree_node_add_writecache_target(node, len, diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 77aad9d..5d1267a 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5230,6 +5230,8 @@ static int _lv_writecache_detach(struct cmd_context *cmd, struct logical_volume lv->status &= ~WRITECACHE; seg->writecache = NULL; + lv_fast->status &= ~LV_CACHE_VOL; + if (!remove_layer_from_lv(lv, origin)) return_0; @@ -5646,6 +5648,8 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd, if (!archive(vg)) goto_bad; + lv_fast->status |= LV_CACHE_VOL; + /* * TODO: use libblkid to get the sector size of lv. If it doesn't * match the block_size we are using for the writecache, then warn that
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
Results per page:
10
25
50
100
200