public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] snapshot creation: only check volumes for fsfreeze
@ 2020-11-23 10:12 Stoiko Ivanov
  2020-11-23 10:25 ` Dominic Jäger
  2020-11-23 12:09 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Stoiko Ivanov @ 2020-11-23 10:12 UTC (permalink / raw)
  To: pve-devel

fix #3161

When considering mountpoints for running 'fsfreeze' before snapshot creation,
commit 8463099d99273561c46398bf02206b4d9d431bc5 did not only consider
volumes created by our storage-stack, but also bindmounts and devmounts
(directly mounting a blockdevice).

This led to PVE::Storage::parse_volume_id failing on those mountpoints.

Since the fsfreeze call is best-effort and only run for specific
storageplugins, we can simply skip non-volume mountpoints, when gathering
the list of volumes to call fsfreeze on.

Tested with a container with a bindmount.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
Sorry for that - will test my container patches with a more complete container
config from now on :/

 src/PVE/LXC/Config.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 9834866..db453f8 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -139,6 +139,8 @@ sub __snapshot_freeze {
     $class->foreach_volume($conf, sub {
 	my ($ms, $mountpoint) = @_;
 
+	return if $mountpoint->{type} ne 'volume';
+
 	if (PVE::Storage::volume_snapshot_needs_fsfreeze($storagecfg, $mountpoint->{volume})) {
 	    push @$freeze_mps, $mountpoint->{mp};
 	}
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH container] snapshot creation: only check volumes for fsfreeze
  2020-11-23 10:12 [pve-devel] [PATCH container] snapshot creation: only check volumes for fsfreeze Stoiko Ivanov
@ 2020-11-23 10:25 ` Dominic Jäger
  2020-11-23 12:09 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Dominic Jäger @ 2020-11-23 10:25 UTC (permalink / raw)
  To: Proxmox VE development discussion

Fixes the issue for me.

Tested-by: Dominic Jäger <d.jaeger@proxmox.com>

On Mon, Nov 23, 2020 at 11:12:29AM +0100, Stoiko Ivanov wrote:
> fix #3161
> 
> When considering mountpoints for running 'fsfreeze' before snapshot creation,
> commit 8463099d99273561c46398bf02206b4d9d431bc5 did not only consider
> volumes created by our storage-stack, but also bindmounts and devmounts
> (directly mounting a blockdevice).
> 
> This led to PVE::Storage::parse_volume_id failing on those mountpoints.
> 
> Since the fsfreeze call is best-effort and only run for specific
> storageplugins, we can simply skip non-volume mountpoints, when gathering
> the list of volumes to call fsfreeze on.
> 
> Tested with a container with a bindmount.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> Sorry for that - will test my container patches with a more complete container
> config from now on :/
> 
>  src/PVE/LXC/Config.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 9834866..db453f8 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -139,6 +139,8 @@ sub __snapshot_freeze {
>      $class->foreach_volume($conf, sub {
>  	my ($ms, $mountpoint) = @_;
>  
> +	return if $mountpoint->{type} ne 'volume';
> +
>  	if (PVE::Storage::volume_snapshot_needs_fsfreeze($storagecfg, $mountpoint->{volume})) {
>  	    push @$freeze_mps, $mountpoint->{mp};
>  	}
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH container] snapshot creation: only check volumes for fsfreeze
  2020-11-23 10:12 [pve-devel] [PATCH container] snapshot creation: only check volumes for fsfreeze Stoiko Ivanov
  2020-11-23 10:25 ` Dominic Jäger
@ 2020-11-23 12:09 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-11-23 12:09 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stoiko Ivanov

On 23.11.20 11:12, Stoiko Ivanov wrote:
> fix #3161
> 
> When considering mountpoints for running 'fsfreeze' before snapshot creation,
> commit 8463099d99273561c46398bf02206b4d9d431bc5 did not only consider
> volumes created by our storage-stack, but also bindmounts and devmounts
> (directly mounting a blockdevice).
> 
> This led to PVE::Storage::parse_volume_id failing on those mountpoints.
> 
> Since the fsfreeze call is best-effort and only run for specific
> storageplugins, we can simply skip non-volume mountpoints, when gathering
> the list of volumes to call fsfreeze on.
> 
> Tested with a container with a bindmount.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> Sorry for that - will test my container patches with a more complete container
> config from now on :/
> 
>  src/PVE/LXC/Config.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, with Dominic's T-b tag thanks!

Please prefix the `fix #ID:` in the commit subject and try to keep lines shorter
than 70 characters[0]

[0]: https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 10:12 [pve-devel] [PATCH container] snapshot creation: only check volumes for fsfreeze Stoiko Ivanov
2020-11-23 10:25 ` Dominic Jäger
2020-11-23 12:09 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal