[pve-devel] applied: [PATCH storage] LVM: lock on volume_resize
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Nov 15 10:14:45 CET 2018
applied
On Wed, Nov 14, 2018 at 02:43:29PM +0100, Thomas Lamprecht wrote:
> This is important for shared LVM storages. As with deletes and
> creates of images, as else we may have not the up-to-date metadata
> and extents may get reused if another node created an image during
> the same time, for example.
>
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
> PVE/Storage/LVMPlugin.pm | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm
> index f4a2566..79d527d 100644
> --- a/PVE/Storage/LVMPlugin.pm
> +++ b/PVE/Storage/LVMPlugin.pm
> @@ -491,7 +491,10 @@ sub volume_resize {
>
> my $path = $class->path($scfg, $volname);
> my $cmd = ['/sbin/lvextend', '-L', $size, $path];
> - run_command($cmd, errmsg => "error resizing volume '$path'");
> +
> + $class->cluster_lock_storage($storeid, $scfg->{shared}, undef, sub {
> + run_command($cmd, errmsg => "error resizing volume '$path'");
> + });
>
> return 1;
> }
> --
> 2.19.1
More information about the pve-devel
mailing list