all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] safe_read_from: bump default size limit to 512k
@ 2020-08-14  7:48 Fabian Grünbichler
  2020-08-19  5:39 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2020-08-14  7:48 UTC (permalink / raw)
  To: pve-devel

this is (via file_get_contents and file_copy) used for reading from
pmxcfs, which has a file size limit of 512k. since quite a number of
call sites would need to explicitly override this (and then get updated
if we bump the limit on the pmxcfs side again in the future), making our
default file reader compatible by default seems the better solution.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---

Notes:
    actual real-world example of hitting this issue:
    
    https://forum.proxmox.com/threads/backup-failed-file-etc-pve-firewall-100-fw-too-long-aborting.74348/

 src/PVE/Tools.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 4399b2f..5d53127 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -288,7 +288,8 @@ sub file_read_firstline {
 sub safe_read_from {
     my ($fh, $max, $oneline, $filename) = @_;
 
-    $max = 32768 if !$max;
+    # pmxcfs file size limit
+    $max = 512*1024 if !$max;
 
     my $subject = defined($filename) ? "file '$filename'" : 'input';
 
-- 
2.20.1





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

* [pve-devel] applied: [PATCH common] safe_read_from: bump default size limit to 512k
  2020-08-14  7:48 [pve-devel] [PATCH common] safe_read_from: bump default size limit to 512k Fabian Grünbichler
@ 2020-08-19  5:39 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-08-19  5:39 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

On 14.08.20 09:48, Fabian Grünbichler wrote:
> this is (via file_get_contents and file_copy) used for reading from
> pmxcfs, which has a file size limit of 512k. since quite a number of
> call sites would need to explicitly override this (and then get updated
> if we bump the limit on the pmxcfs side again in the future), making our
> default file reader compatible by default seems the better solution.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
> 
> Notes:
>     actual real-world example of hitting this issue:
>     
>     https://forum.proxmox.com/threads/backup-failed-file-etc-pve-firewall-100-fw-too-long-aborting.74348/
> 
>  src/PVE/Tools.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
>

applied, thanks!





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

end of thread, other threads:[~2020-08-19  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  7:48 [pve-devel] [PATCH common] safe_read_from: bump default size limit to 512k Fabian Grünbichler
2020-08-19  5:39 ` [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