[pve-devel] [PATCH common] fix #1938: /proc/mounts too long

David Limbeck d.limbeck at proxmox.com
Wed Oct 3 12:08:39 CEST 2018


So something like: "fix #1938: increase maximum file size to accommodate 
a larger /proc/mounts"?

On 10/3/18 12:05 PM, Wolfgang Bumiller wrote:
> I'd prefer a description of the code rather than the error message in
> the commit message. (Ideally the error (and how to reach it) are added
> as well, just not in the header line.)
>
> On Tue, Oct 02, 2018 at 04:13:23PM +0200, David Limbeck wrote:
>> Signed-off-by: David Limbeck <d.limbeck at proxmox.com>
>> ---
>> Would a bigger filesize (1M or more) be more approriate?
> Given that /proc/mounts is rather limited (usually... by design (sort
> of)), I wouldn't object to any arbitrarily large number here (or
> teaching file_get_contents an explicit 'unlimited' value), I think
> Dietmar has a stronger opinion here?
>
>>   src/PVE/ProcFSTools.pm | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
>> index 80c0425..1b98b1e 100644
>> --- a/src/PVE/ProcFSTools.pm
>> +++ b/src/PVE/ProcFSTools.pm
>> @@ -292,7 +292,7 @@ sub read_proc_net_route {
>>   }
>>   
>>   sub read_proc_mounts {
>> -    return PVE::Tools::file_get_contents("/proc/mounts", 128*1024);
>> +    return PVE::Tools::file_get_contents("/proc/mounts", 512*1024);
>>   }
>>   
>>   # mounts encode spaces (\040), tabs (\011), newlines (\012), backslashes (\\ or \134)
>> -- 
>> 2.11.0




More information about the pve-devel mailing list