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.gruenbich...@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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel