diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-28 20:31:01 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-28 20:31:01 +0000 |
commit | daa10ad0fdf30c573ce2a63d56396a7fb81bef20 (patch) | |
tree | afaed06de3f88bb2949e852a9cbce58ce276d392 /tools/lvresize.c | |
parent | e5b12b305f4b365b6433a3d4bc5f95de489ae88e (diff) | |
download | lvm2-daa10ad0fdf30c573ce2a63d56396a7fb81bef20.tar.gz lvm2-daa10ad0fdf30c573ce2a63d56396a7fb81bef20.tar.xz lvm2-daa10ad0fdf30c573ce2a63d56396a7fb81bef20.zip |
Thin pool resize support for data LV
Support for extension of pool data LV.
TODO: figure out thin volume for suspend/resume in cluster.
Diffstat (limited to 'tools/lvresize.c')
-rw-r--r-- | tools/lvresize.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c index f4b81da3..96305525 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. - * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. * @@ -669,6 +669,25 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, } } + if (lv_is_thin_pool(lv)) { + if (lp->resize == LV_REDUCE) { + log_error("Thin pool volumes cannot be reduced in size yet."); + return ECMD_FAILED; + } + + if (lp->resizefs) { + log_warn("Thin pool volumes do not have filesystem."); + lp->resizefs = 0; + } + + if (!lp->stripes) { + /* Try to use the same strip settings for underlying pool data LV */ + lp->stripes = last_seg(seg_lv(first_seg(lv), 0))->area_count; + if (!lp->stripe_size) + lp->stripe_size = last_seg(seg_lv(first_seg(lv), 0))->stripe_size; + } + } + if ((lp->resize == LV_REDUCE) && lp->argc) log_warn("Ignoring PVs on command line when reducing"); @@ -730,6 +749,10 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, /* If snapshot, must suspend all associated devices */ if (lv_is_cow(lv)) lock_lv = origin_from_cow(lv); + else if (lv_is_used_thin_pool(lv)) + // FIXME: what to pick here - maybe an active thin? + // but it still seems to be racy in cluster + lock_lv = lv; else lock_lv = lv; |