summaryrefslogtreecommitdiff
path: root/tools/pvchange.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-01-15 15:18:25 -0600
committerDavid Teigland <teigland@redhat.com>2016-01-18 09:35:06 -0600
commit54b41dcd53d99059b691f72eb6e7556d4341634d (patch)
tree9062ccf42797b3e602e6be6281fa08affe49c591 /tools/pvchange.c
parent1ee6af344bd805d4fa847b95b326c2fe1e52d7cd (diff)
downloadlvm2-54b41dcd53d99059b691f72eb6e7556d4341634d.tar.gz
pvchange, pvresize: fix lockd_gl() usage
When an orphan PV is changed/resized, the lvmlockd global lock is converted from sh to ex. If the command is changing two orphan PVs, the conversion to ex should be done only once.
Diffstat (limited to 'tools/pvchange.c')
-rw-r--r--tools/pvchange.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c
index 91e93c1e7..fad28d194 100644
--- a/tools/pvchange.c
+++ b/tools/pvchange.c
@@ -87,8 +87,11 @@ static int _pvchange_single(struct cmd_context *cmd, struct volume_group *vg,
* i.e. the global lock is only needed for orphans.
* Convert sh to ex.
*/
- if (is_orphan(pv) && !lockd_gl(cmd, "ex", 0))
- return_ECMD_FAILED;
+ if (is_orphan(pv)) {
+ if (!lockd_gl(cmd, "ex", 0))
+ return_ECMD_FAILED;
+ cmd->lockd_gl_disable = 1;
+ }
if (tagargs) {
/* tag or deltag */