mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pvremove: skip lvmlockd locks for forced clearing
pvremove -ff to force clear a PV shouldn't care if lvmlockd locks fail.
This commit is contained in:
parent
5c5e449dc5
commit
3759a1f62b
@ -39,10 +39,19 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
* (disable afterward to prevent process_each_pv from doing
|
* (disable afterward to prevent process_each_pv from doing
|
||||||
* a shared global lock since it's already acquired it ex.)
|
* a shared global lock since it's already acquired it ex.)
|
||||||
*/
|
*/
|
||||||
if (!lockd_gl(cmd, "ex", 0))
|
if (!lockd_gl(cmd, "ex", 0)) {
|
||||||
return_ECMD_FAILED;
|
/* Let pvremove -ff skip locks */
|
||||||
|
if (pp.force == DONT_PROMPT_OVERRIDE)
|
||||||
|
log_warn("WARNING: skipping global lock in lvmlockd for force.");
|
||||||
|
else
|
||||||
|
return_ECMD_FAILED;
|
||||||
|
}
|
||||||
cmd->lockd_gl_disable = 1;
|
cmd->lockd_gl_disable = 1;
|
||||||
|
|
||||||
|
/* When forcibly clearing a PV we don't care about a VG lock. */
|
||||||
|
if (pp.force == DONT_PROMPT_OVERRIDE)
|
||||||
|
cmd->lockd_vg_disable = 1;
|
||||||
|
|
||||||
if (!(handle = init_processing_handle(cmd, NULL))) {
|
if (!(handle = init_processing_handle(cmd, NULL))) {
|
||||||
log_error("Failed to initialize processing handle.");
|
log_error("Failed to initialize processing handle.");
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
|
Loading…
Reference in New Issue
Block a user