[pve-devel] [PATCH storage] fix #2226: ignore broken symlinks in template_list

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Jun 13 16:30:09 CEST 2019


On 6/13/19 3:55 PM, Stefan Reiter wrote:
> This is currently the case for all files with unknown extensions placed in one of these directories, so I followed that example. Neither solution feels perfect to be honest, but a GUI extension (status column? error in size field?) seems overkill for something rather niche (that shouldn't happen in regular use anyway).

Yes but that's a totally different story.
Ignoring non ISOs or templates or the like is OK for an API call
which should return ISOs and Templates (i.e., a specific set of
files).

For files which _would_ match ISOs but is broken in another way it
cannot be argued totally the same, IMO. I mean if I do
# touch empty.iso
in a ISO directory it won't work either but shows up just fine,
so why differing with dead links?  Also, with my approach one can
cleanup the dangling link from API, with yours not.

I don't say I think it must be 100% correct and clear what I proposed.
If you can argue against it reasonably fine..
I think here in such a case it's best to also ask the bug
reporter what they even expected to happen, as they produced this
edge case in the first place. Or at least propose the ways you
could imagine to solve this.

Personally, I would not expect that this gets hidden just once it's
dangling, rather see "size 0" so I know something is off and can go
inspect what/why.. Silently dropping stuff which would else matched
the criteria is not to best resolution here, IMO.

>> Maybe just do a
>>
>> $info->{size} = -s $fn // 0;
>>
>> instead?
>>
> I'll send v2 with this logic, if you want.
> 
> I will definitely include the same fix for snippets, as Oguz mentioned in his mail.
> 





More information about the pve-devel mailing list