From c2aed8aaff7f092cb5ab5d5ce38a98e0ef1a6adc Mon Sep 17 00:00:00 2001 From: Martin Kühne Date: Tue, 11 Oct 2016 18:36:17 +0200 Subject: Use f_bavail for diskspace calculations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should make pacman's behavior consistent with GNU coreutils df, as well as follow advice from affected filesystems' devs as well as `man statvfs`. This fixes FS#37402 Signed-off-by: Martin Kühne Signed-off-by: Allan McRae (cherry picked from commit 8c55c0096c355e973ce6111cb25a1c4fa05953cf) --- lib/libalpm/diskspace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index da4ad560..55343c16 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -348,11 +348,11 @@ static int check_mountpoint(alpm_handle_t *handle, alpm_mountpoint_t *mp) _alpm_log(handle, ALPM_LOG_DEBUG, "partition %s, needed %jd, cushion %ju, free %ju\n", mp->mount_dir, (intmax_t)mp->max_blocks_needed, - (uintmax_t)cushion, (uintmax_t)mp->fsp.f_bfree); - if(needed >= 0 && (fsblkcnt_t)needed > mp->fsp.f_bfree) { + (uintmax_t)cushion, (uintmax_t)mp->fsp.f_bavail); + if(needed >= 0 && (fsblkcnt_t)needed > mp->fsp.f_bavail) { _alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s too full: %jd blocks needed, %ju blocks free\n"), - mp->mount_dir, (intmax_t)needed, (uintmax_t)mp->fsp.f_bfree); + mp->mount_dir, (intmax_t)needed, (uintmax_t)mp->fsp.f_bavail); return 1; } return 0; -- cgit v1.2.3-70-g09d2