mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
vgchange: check for mounted fs
Check for mounted fs also for vgchange command, not just lvchange. NOTE: Code is using lv_info() just like lvs_in_vg_opened(). It should be probably converted into lv_is_active_locally().
This commit is contained in:
parent
810bc4f8c1
commit
2ada982e73
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.99 -
|
Version 2.02.99 -
|
||||||
===================================
|
===================================
|
||||||
|
Add detection of mounted fs also for vgchange deactivation.
|
||||||
Replace 'lv_is_active' with more correct/specific variants (e.g. *_locally).
|
Replace 'lv_is_active' with more correct/specific variants (e.g. *_locally).
|
||||||
Refuse to init a snapshot merge in lvconvert if there's no kernel support.
|
Refuse to init a snapshot merge in lvconvert if there's no kernel support.
|
||||||
Fix exported symbols regex for non-GNU busybox sed.
|
Fix exported symbols regex for non-GNU busybox sed.
|
||||||
|
@ -191,6 +191,8 @@ int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
activation_change_t activate)
|
activation_change_t activate)
|
||||||
{
|
{
|
||||||
int lv_open, active, monitored = 0, r = 1, do_activate = 1;
|
int lv_open, active, monitored = 0, r = 1, do_activate = 1;
|
||||||
|
const struct lv_list *lvl;
|
||||||
|
struct lvinfo info;
|
||||||
|
|
||||||
if ((activate == CHANGE_AN) || (activate == CHANGE_ALN))
|
if ((activate == CHANGE_AN) || (activate == CHANGE_ALN))
|
||||||
do_activate = 0;
|
do_activate = 0;
|
||||||
@ -203,9 +205,14 @@ int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
|
|
||||||
/* FIXME: Force argument to deactivate them? */
|
/* FIXME: Force argument to deactivate them? */
|
||||||
if (!do_activate && (lv_open = lvs_in_vg_opened(vg))) {
|
if (!do_activate && (lv_open = lvs_in_vg_opened(vg))) {
|
||||||
log_error("Can't deactivate volume group \"%s\" with %d open "
|
dm_list_iterate_items(lvl, &vg->lvs)
|
||||||
"logical volume(s)", vg->name, lv_open);
|
if (lv_is_visible(lvl->lv) &&
|
||||||
return 0;
|
lv_info(cmd, lvl->lv, 0, &info, 1, 0) &&
|
||||||
|
!lv_check_not_in_use(cmd, lvl->lv, &info)) {
|
||||||
|
log_error("Can't deactivate volume group \"%s\" with %d open "
|
||||||
|
"logical volume(s)", vg->name, lv_open);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME Move into library where clvmd can use it */
|
/* FIXME Move into library where clvmd can use it */
|
||||||
|
Loading…
Reference in New Issue
Block a user