From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <m.heiserer@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id D55A888ADA
 for <pbs-devel@lists.proxmox.com>; Thu, 28 Jul 2022 15:29:09 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id CC926434C
 for <pbs-devel@lists.proxmox.com>; Thu, 28 Jul 2022 15:28:39 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pbs-devel@lists.proxmox.com>; Thu, 28 Jul 2022 15:28:38 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 711F041F81
 for <pbs-devel@lists.proxmox.com>; Thu, 28 Jul 2022 15:28:38 +0200 (CEST)
Message-ID: <7e801b2c-db57-5b04-e414-46cc86609db4@proxmox.com>
Date: Thu, 28 Jul 2022 15:28:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.11.0
Content-Language: en-US
To: pbs-devel@lists.proxmox.com
References: <20220726134441.403635-1-d.tschlatscher@proxmox.com>
 <20220726134441.403635-2-d.tschlatscher@proxmox.com>
From: Matthias Heiserer <m.heiserer@proxmox.com>
In-Reply-To: <20220726134441.403635-2-d.tschlatscher@proxmox.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.173 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.001 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 2/3] expose the
 unpriviliged total in the api and use it in the GUI
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Thu, 28 Jul 2022 13:29:09 -0000

On 26.07.2022 15:44, Daniel Tschlatscher wrote:
> Until now, the total size for a datastore was reported as the total
> space on the filesystem. On ext4 filesystems this number will not
> match the observed behaviour when some amount of blocks are reserved
> though, as the proxmox-backup-proxy uses the unpriviliged 'backup'
> user. Therefore backup-ing new data would fail, even though the GUI
> still displays that X% of the datastore is free.
> I think using the unpriviliged total makes more sense as it
> communicates to the user how much they can actually still store on the
> datastore, rather than the full total of which some part might not be
> usable.
> 
> This will also not lead to issues in the GUI when the reserved space
> is written to, because the value reported by statfs will automatically
> increase accordingly.
> I.e. when the unprivliged space is full and a 500MB file is written by
> the root user, the fields for "unpriv_total" and "used" will both
> increase by this amount, simply keeping the usage at 100%.
> 
> Note: I've opted to create a new field in the API result for the
> unpriviliged total of the datastore, as overwriting the existing total
> might break compatibility for users who retrieve the actual datastore
> disk size this way.
It's "privileged" :)

Looks good to me. I filled up the datastore on a pbs, and it said "Full".

Tested-by: Matthias Heiserer <m.heiserer@proxmox.com>