1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-04 12:22:00 +03:00

lockd: fix error cases when built without lvmlockd

When lvm is built without lvmlockd support, vgcreate using a
shared lock type would succeed and create a local VG (the
--shared option was effectively ignored).  Make it fail.

Fix the same issue when using vgchange to change a VG to a
shared lock type.

Make the error messages consistent.
This commit is contained in:
David Teigland
2015-07-16 15:12:07 -05:00
parent b93b85378d
commit 268f53ed0d
3 changed files with 23 additions and 4 deletions

View File

@ -167,6 +167,14 @@ static inline int lockd_start_wait(struct cmd_context *cmd)
static inline int lockd_gl_create(struct cmd_context *cmd, const char *def_mode, const char *vg_lock_type)
{
/*
* When lvm is built without lvmlockd support, creating a VG with
* a shared lock type should fail.
*/
if (is_lockd_type(vg_lock_type)) {
log_error("Using a shared lock type requires lvmlockd.");
return 0;
}
return 1;
}
@ -220,6 +228,7 @@ static inline int lockd_free_lv(struct cmd_context *cmd, struct volume_group *vg
static inline const char *lockd_running_lock_type(struct cmd_context *cmd)
{
log_error("Using a shared lock type requires lvmlockd.");
return NULL;
}