Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use /proc/mounts instead of statfs(2) for ro state (prometheus#1002)
While the statfs(2) approach is reliable for normally mounted filesystems, the flags returned can be inconsistent when filesystem has been remounted read-only after encountering an error. The returned flags do accurately represent the internal state of the filesystem, but they do not reflect whether the VFS layer will accept writes. Instead, it makes sense to parse the current VFS mount state from the options field in /proc/mounts since it takes precedence. Signed-off-by: Brandon Gilmore <bgilmore@valvesoftware.com>
- Loading branch information