Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Aug 2023 09:31:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273094] getfsstat can return unexpectedly stale statfs data.
Message-ID:  <bug-273094-227-fQmSCjqeM4@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-273094-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-273094-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273094

--- Comment #1 from Peter Jeremy <peterj@FreeBSD.org> ---
Actually, having more carefully read the sources, statfs(2) doesn't update =
the
cached values, only calling getfsstat(2) with MNT_WAIT works.  I think that=
's
even more of a POLA violation because it means that data returned by
getfstatfs() can be older than data returned by statfs().

IMO, the logic in kern/vfs_mount.c:__vfs_statfs() should be inverted so tha=
t it
always calls mp->mnt_op->vfs_statfs(mp, &mp->mnt_stat) and then copies the
result to sbp if required, though I'm not sure of the subtleties that may be
involved.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273094-227-fQmSCjqeM4>