diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-11-08 12:19:53 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-11-08 12:19:53 +0000 |
commit | 6b58c7960375209ebd4a7bfca982c63779cdcb32 (patch) | |
tree | 50d65f559aac7eda19ad6b4fd6b12fc32db4217f /tools/lvresize.c | |
parent | 65b977f249574082dfa04c5830b633e29d72402c (diff) | |
download | lvm2-6b58c7960375209ebd4a7bfca982c63779cdcb32.tar.gz lvm2-6b58c7960375209ebd4a7bfca982c63779cdcb32.tar.xz lvm2-6b58c7960375209ebd4a7bfca982c63779cdcb32.zip |
Thin ensure pool table is update after resize
Always make sure table gets reloaded.
For now activate and deactivate pool volume if it's not active.
FIXME: we could do this only if we are sure some thin volume is alive.
Diffstat (limited to 'tools/lvresize.c')
-rw-r--r-- | tools/lvresize.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c index aafef6f6..6107843a 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -781,6 +781,20 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, backup(vg); + /* + * Update lvm pool metadata (drop messages) if the pool has been + * resumed and do a pool active/deactivate in other case. + * + * Note: Active thin pool can be waiting for resize. + * + * FIXME: Activate only when thin volume is active + */ + if (lv_is_thin_pool(lv) && + !update_pool_lv(lv, !lv_is_active(lv))) { + stack; + return ECMD_FAILED; + } + log_print("Logical volume %s successfully resized", lp->lv_name); if (lp->resizefs && (lp->resize == LV_EXTEND) && |