* [pve-devel] [PATCH storage] file_size_info: handle dangling symlinks
@ 2020-10-02 11:55 Fabian Grünbichler
2020-10-05 10:52 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2020-10-02 11:55 UTC (permalink / raw)
To: pve-devel
and other stat failure modes.
this method returns undef if 'qemu-img info ...' fails to return
information, so callers must handle this already.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
Notes:
https://forum.proxmox.com/threads/local-storage-unable-to-display-content.76741
PVE/Storage/Plugin.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index e6cd99c..63f68da 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -783,6 +783,12 @@ sub file_size_info {
my $st = File::stat::stat($filename);
+ if (!defined($st)) {
+ my $extramsg = -l $filename ? ' - dangling symlink?' : '';
+ warn "failed to stat '$filename'$extramsg\n";
+ return undef;
+ }
+
if (S_ISDIR($st->mode)) {
return wantarray ? (0, 'subvol', 0, undef, $st->ctime) : 1;
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH storage] file_size_info: handle dangling symlinks
2020-10-02 11:55 [pve-devel] [PATCH storage] file_size_info: handle dangling symlinks Fabian Grünbichler
@ 2020-10-05 10:52 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-10-05 10:52 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Grünbichler
On 02.10.20 13:55, Fabian Grünbichler wrote:
> and other stat failure modes.
>
> this method returns undef if 'qemu-img info ...' fails to return
> information, so callers must handle this already.
>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>
> Notes:
> https://forum.proxmox.com/threads/local-storage-unable-to-display-content.76741
>
> PVE/Storage/Plugin.pm | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-05 10:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 11:55 [pve-devel] [PATCH storage] file_size_info: handle dangling symlinks Fabian Grünbichler
2020-10-05 10:52 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal