]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vfs: fix up r351193 ("stop always overwriting ->mnt_stat in VFS_STATFS")
authormjg <mjg@FreeBSD.org>
Mon, 19 Aug 2019 14:11:54 +0000 (14:11 +0000)
committermjg <mjg@FreeBSD.org>
Mon, 19 Aug 2019 14:11:54 +0000 (14:11 +0000)
commit2147ca90dbdf562cd198cac94d7eae3b164f3cb5
tree77ac393d187c3864f01ac9d30505414d47458ed6
parent700a658772ce3493fe2064b31f9acce6a20f028b
vfs: fix up r351193 ("stop always overwriting ->mnt_stat in VFS_STATFS")

fs-specific part of vfs_statfs routines only fill in small portion of the
structure. Previous code was always copying everything at a higher layer to
acoomodate it and this patch does the same.

'df' (no arguments) worked fine because the caller uses mnt_stat itself as the
target buffer, making all the copying a no-op for its own case.
'df /' and similar use a different consumer which passes its own buffer and
this is where you can run into trouble.

Reported by: cy
Fixes: r351193
Sponsored by: The FreeBSD Foundation
sys/kern/vfs_mount.c