Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 572063 Details for
Bug 742706
Allow conversion from local activation to exclusive for clustered LV
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
convertlock option lvm2-2.0.95
lvm2-2_02_95-convertlock.patch (text/plain), 11.02 KB, created by
Roman
on 2012-03-22 18:49:34 UTC
(
hide
)
Description:
convertlock option lvm2-2.0.95
Filename:
MIME Type:
Creator:
Roman
Created:
2012-03-22 18:49:34 UTC
Size:
11.02 KB
patch
obsolete
>diff -Nru a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c >--- a/daemons/clvmd/lvm-functions.c 2012-03-02 02:55:21.000000000 +0400 >+++ b/daemons/clvmd/lvm-functions.c 2012-03-22 21:35:31.926272015 +0400 >@@ -137,7 +137,7 @@ > flags & LCK_DMEVENTD_MONITOR_MODE ? "DMEVENTD_MONITOR|" : "", > flags & LCK_ORIGIN_ONLY_MODE ? "ORIGIN_ONLY|" : "", > flags & LCK_TEST_MODE ? "TEST|" : "", >- flags & LCK_CONVERT ? "CONVERT|" : "", >+ flags & LCK_CONVERT_MODE ? "CONVERT|" : "", > flags & LCK_DMEVENTD_MONITOR_IGNORE ? "DMEVENTD_MONITOR_IGNORE|" : ""); > > if (len > 1) >@@ -374,7 +374,7 @@ > * of exclusive lock to shared one during activation. > */ > if (command & LCK_CLUSTER_VG) { >- status = hold_lock(resource, mode, LCKF_NOQUEUE | (lock_flags & LCK_CONVERT ? LCKF_CONVERT:0)); >+ status = hold_lock(resource, mode, LCKF_NOQUEUE | (lock_flags & LCK_CONVERT_MODE ? LCKF_CONVERT:0)); > if (status) { > /* Return an LVM-sensible error for this. > * Forcing EIO makes the upper level return this text >diff -Nru a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c >--- a/lib/locking/cluster_locking.c 2012-01-21 09:29:52.000000000 +0400 >+++ b/lib/locking/cluster_locking.c 2012-03-22 21:37:17.901273610 +0400 >@@ -323,6 +323,9 @@ > > args[1] = 0; > >+ if (flags & LCK_CONVERT) >+ args[1] |= LCK_CONVERT_MODE; >+ > if (flags & LCK_ORIGIN_ONLY) > args[1] |= LCK_ORIGIN_ONLY_MODE; > >diff -Nru a/lib/locking/locking.h b/lib/locking/locking.h >--- a/lib/locking/locking.h 2012-02-27 13:52:37.000000000 +0400 >+++ b/lib/locking/locking.h 2012-03-22 22:20:58.073285395 +0400 >@@ -101,6 +101,7 @@ > #define LCK_CACHE 0x00000100U /* Operation on cache only using P_ lock */ > #define LCK_ORIGIN_ONLY 0x00000200U /* Operation should bypass any snapshots */ > #define LCK_REVERT 0x00000400U /* Revert any incomplete change */ >+#define LCK_CONVERT 0x00001000U /* Allow lock convertion */ > > /* > * Additional lock bits for cluster communication via args[1] >@@ -108,10 +109,7 @@ > #define LCK_PARTIAL_MODE 0x01 /* Partial activation? */ > #define LCK_MIRROR_NOSYNC_MODE 0x02 /* Mirrors don't require sync */ > #define LCK_DMEVENTD_MONITOR_MODE 0x04 /* Register with dmeventd */ >- >-/* Not yet used. */ >-#define LCK_CONVERT 0x08 /* Convert existing lock */ >- >+#define LCK_CONVERT_MODE 0x08 /* Convert existing lock */ > #define LCK_TEST_MODE 0x10 /* Test mode: No activation */ > #define LCK_ORIGIN_ONLY_MODE 0x20 /* Same as above */ > #define LCK_DMEVENTD_MONITOR_IGNORE 0x40 /* Whether to ignore dmeventd */ >@@ -181,6 +179,8 @@ > #define activate_lv(cmd, lv) lock_lv_vol(cmd, lv, LCK_LV_ACTIVATE | LCK_HOLD) > #define activate_lv_excl_local(cmd, lv) \ > lock_lv_vol(cmd, lv, LCK_LV_EXCLUSIVE | LCK_HOLD | LCK_LOCAL) >+#define activate_lv_excl_convert(cmd, lv) \ >+ lock_lv_vol(cmd, lv, LCK_LV_EXCLUSIVE | LCK_HOLD | LCK_LOCAL | LCK_CONVERT) > #define activate_lv_excl_remote(cmd, lv) \ > lock_lv_vol(cmd, lv, LCK_LV_EXCLUSIVE | LCK_HOLD | LCK_REMOTE) > >@@ -189,6 +189,8 @@ > > #define activate_lv_local(cmd, lv) \ > lock_lv_vol(cmd, lv, LCK_LV_ACTIVATE | LCK_HOLD | LCK_LOCAL) >+#define activate_lv_local_convert(cmd, lv) \ >+ lock_lv_vol(cmd, lv, LCK_LV_ACTIVATE | LCK_HOLD | LCK_LOCAL | LCK_CONVERT) > #define deactivate_lv_local(cmd, lv) \ > lock_lv_vol(cmd, lv, LCK_LV_DEACTIVATE | LCK_LOCAL) > #define drop_cached_metadata(vg) \ >diff -Nru a/man/lvchange.8.in b/man/lvchange.8.in >--- a/man/lvchange.8.in 2010-05-06 15:15:55.000000000 +0400 >+++ b/man/lvchange.8.in 2012-03-22 21:44:22.785285439 +0400 >@@ -5,6 +5,7 @@ > .B lvchange > [\-\-addtag Tag] > [\-A|\-\-autobackup y|n] [\-a|\-\-available y|n|ey|en|ly|ln] >+[\-\-convertlock] > [\-\-alloc AllocationPolicy] > [\-C|\-\-contiguous y|n] [\-d|\-\-debug] [\-\-deltag Tag] > [\-\-resync] >@@ -45,6 +46,10 @@ > logical volume's allocation policy to contiguous, if all of the > allocated physical extents are already contiguous. > .TP >+.I \-\-convertlock >+Allow conversion between exclusively (EX) and concurrent read (CR) >+locks during volume activation. >+.TP > .I \-\-resync > Forces the complete resynchronization of a mirror. In normal > circumstances you should not need this option because synchronization >diff -Nru a/man/vgchange.8.in b/man/vgchange.8.in >--- a/man/vgchange.8.in 2010-07-13 19:04:23.000000000 +0400 >+++ b/man/vgchange.8.in 2012-03-22 21:45:39.288285648 +0400 >@@ -9,6 +9,7 @@ > .IR AllocationPolicy ] > .RB [ \-A | \-\-autobackup " {" y | n }] > .RB [ \-a | \-\-available " [e|l] {" y | n }] >+.RB [ \-\-convertlock] > .RB [ \-\-monitor " {" y | n }] > .RB [ \-\-poll " {" y | n }] > .RB [ \-c | \-\-clustered " {" y | n }] >@@ -80,6 +81,10 @@ > .BR \-u ", " \-\-uuid > Generate new random UUID for specified Volume Groups. > .TP >+.BR \-\-convertlock >+Allow conversion between exclusively (EX) and concurrent read (CR) >+locks during volumes activation. >+.TP > .BR \-\-monitor " " { y | n } > Start or stop monitoring a mirrored or snapshot logical volume with > dmeventd, if it is installed. >diff -Nru a/tools/args.h b/tools/args.h >--- a/tools/args.h 2012-03-06 06:30:50.000000000 +0400 >+++ b/tools/args.h 2012-03-22 21:46:04.467273998 +0400 >@@ -75,6 +75,7 @@ > arg(stripes_long_ARG, '\0', "stripes", int_arg, 0) > arg(sysinit_ARG, '\0', "sysinit", NULL, 0) > arg(thinpool_ARG, '\0', "thinpool", string_arg, 0) >+arg(convertlock_ARG, '\0', "convertlock", NULL, 0) > > /* Allow some variations */ > arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0) >diff -Nru a/tools/commands.h b/tools/commands.h >--- a/tools/commands.h 2012-03-06 07:11:13.000000000 +0400 >+++ b/tools/commands.h 2012-03-22 21:48:07.787331231 +0400 >@@ -62,6 +62,7 @@ > "lvchange\n" > "\t[-A|--autobackup y|n]\n" > "\t[-a|--available [e|l]y|n]\n" >+ "\t[--convertlock]\n" > "\t[--addtag Tag]\n" > "\t[--alloc AllocationPolicy]\n" > "\t[-C|--contiguous y|n]\n" >@@ -87,8 +88,8 @@ > "\t[--version]" "\n" > "\tLogicalVolume[Path] [LogicalVolume[Path]...]\n", > >- alloc_ARG, autobackup_ARG, available_ARG, contiguous_ARG, force_ARG, >- ignorelockingfailure_ARG, ignoremonitoring_ARG, major_ARG, minor_ARG, >+ alloc_ARG, autobackup_ARG, available_ARG, contiguous_ARG, convertlock_ARG, >+ force_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG, major_ARG, minor_ARG, > monitor_ARG, noudevsync_ARG, partial_ARG, permission_ARG, persistent_ARG, > poll_ARG, readahead_ARG, resync_ARG, refresh_ARG, addtag_ARG, deltag_ARG, > sysinit_ARG, test_ARG, yes_ARG) >@@ -734,6 +735,7 @@ > "\t[-u|--uuid] " "\n" > "\t[-v|--verbose] " "\n" > "\t[--version]" "\n" >+ "\t[--convertlock]" "\n" > "\t{-a|--available [e|l]{y|n} |" "\n" > "\t -c|--clustered {y|n} |" "\n" > "\t -x|--resizeable {y|n} |" "\n" >@@ -745,9 +747,9 @@ > "\t[VolumeGroupName...]\n", > > addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, available_ARG, >- clustered_ARG, deltag_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG, >- logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG, >- metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG, >+ clustered_ARG, convertlock_ARG, deltag_ARG, ignorelockingfailure_ARG, >+ ignoremonitoring_ARG, logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, >+ noudevsync_ARG, metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG, > physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG, > resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG) > >diff -Nru a/tools/lvchange.c b/tools/lvchange.c >--- a/tools/lvchange.c 2012-03-06 06:30:50.000000000 +0400 >+++ b/tools/lvchange.c 2012-03-22 21:52:01.838273028 +0400 >@@ -130,8 +130,10 @@ > struct logical_volume *lv) > { > int activate; >+ int convertlock; > > activate = arg_uint_value(cmd, available_ARG, 0); >+ convertlock = arg_count(cmd, convertlock_ARG); > > if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv))) > lv = origin_from_cow(lv); >@@ -151,13 +153,23 @@ > lv_is_thin_type(lv)) { > log_verbose("Activating logical volume \"%s\" " > "exclusively", lv->name); >- if (!activate_lv_excl(cmd, lv)) >- return_0; >+ if (!convertlock) { >+ if (!activate_lv_excl(cmd, lv)) >+ return_0; >+ } else { >+ if (!activate_lv_excl_convert(cmd, lv)) >+ return_0; >+ } > } else if (activate == CHANGE_ALY) { > log_verbose("Activating logical volume \"%s\" locally", > lv->name); >- if (!activate_lv_local(cmd, lv)) >- return_0; >+ if (!convertlock) { >+ if (!activate_lv_local(cmd, lv)) >+ return_0; >+ } else { >+ if (!activate_lv_local_convert(cmd, lv)) >+ return_0; >+ } > } else { > log_verbose("Activating logical volume \"%s\"", > lv->name); >@@ -758,11 +770,20 @@ > } > > if ((arg_count(cmd, ignorelockingfailure_ARG) || >- arg_count(cmd, sysinit_ARG)) && update) { >- log_error("Only -a permitted with --ignorelockingfailure and --sysinit"); >+ arg_count(cmd, sysinit_ARG) || arg_count(cmd, convertlock_ARG)) && update) { >+ log_error("Only -a permitted with --convertlock, --ignorelockingfailure " >+ "and --sysinit"); > return EINVALID_CMD_LINE; > } > >+ if (arg_count(cmd, convertlock_ARG)) { >+ int activate = arg_uint_value(cmd, available_ARG, 0); >+ if (activate != CHANGE_AE && activate != CHANGE_ALY) { >+ log_error("Lock convertion valid only with -a[e|l]y"); >+ return EINVALID_CMD_LINE; >+ } >+ } >+ > if (!update) > cmd->handles_missing_pvs = 1; > >diff -Nru a/tools/vgchange.c b/tools/vgchange.c >--- a/tools/vgchange.c 2012-02-28 18:24:59.000000000 +0400 >+++ b/tools/vgchange.c 2012-03-22 21:56:55.834274677 +0400 >@@ -89,6 +89,7 @@ > struct lv_list *lvl; > struct logical_volume *lv; > int count = 0, expected_count = 0; >+ int convertlock = arg_count(cmd, convertlock_ARG); > > sigint_allow(); > dm_list_iterate_items(lvl, &vg->lvs) { >@@ -149,14 +150,28 @@ > lv_is_origin(lv) || > lv_is_thin_type(lv)) { > /* FIXME: duplicated test code with lvchange */ >- if (!activate_lv_excl(cmd, lv)) { >- stack; >- continue; >+ if (!convertlock) { >+ if (!activate_lv_excl(cmd, lv)) { >+ stack; >+ continue; >+ } >+ } else { >+ if (!activate_lv_excl_convert(cmd, lv)) { >+ stack; >+ continue; >+ } > } > } else if (activate == CHANGE_ALY) { >- if (!activate_lv_local(cmd, lv)) { >- stack; >- continue; >+ if (!convertlock) { >+ if (!activate_lv_local(cmd, lv)) { >+ stack; >+ continue; >+ } >+ } else { >+ if (!activate_lv_local_convert(cmd, lv)) { >+ stack; >+ continue; >+ } > } > } else if (!activate_lv(cmd, lv)) { > stack; >@@ -570,11 +585,20 @@ > } > > if ((arg_count(cmd, ignorelockingfailure_ARG) || >- arg_count(cmd, sysinit_ARG)) && update) { >- log_error("Only -a permitted with --ignorelockingfailure and --sysinit"); >+ arg_count(cmd, sysinit_ARG) || arg_count(cmd, convertlock_ARG)) && update) { >+ log_error("Only -a permitted with --convertlock, --ignorelockingfailure " >+ "and --sysinit"); > return EINVALID_CMD_LINE; > } > >+ if (arg_count(cmd, convertlock_ARG)) { >+ int activate = arg_uint_value(cmd, available_ARG, 0); >+ if (activate != CHANGE_AE && activate != CHANGE_ALY) { >+ log_error("Lock convertion valid only with -a[e|l]y"); >+ return EINVALID_CMD_LINE; >+ } >+ } >+ > if (arg_count(cmd, available_ARG) && > (arg_count(cmd, monitor_ARG) || arg_count(cmd, poll_ARG))) { > int activate = arg_uint_value(cmd, available_ARG, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 742706
:
525884
|
525885
| 572063 |
735445