Documentation
¶
Overview ¶
Package datafs classifies the filesystem under Ether's data folder and checks, in that folder, the semantics the payload store and SQLite rely on.
The payload store proves a crashed process is gone by taking the exclusive lock it held on a witness file. That proof needs locks that really exclude and are released when the holder dies, stable file identity, in-place rewrite with fsync, and atomic rename and remove. A known local filesystem has all of them. A network filesystem cannot give the first across machines, whatever a local test shows. Anything else is probed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Held ¶
Held reports that TryLock failed because another open file holds the lock, as opposed to the filesystem not supporting locks.
func Hint ¶
Hint says, in English for logs and startup errors, what to change for a filesystem Ether cannot fully trust, or "" (#259).
func HintKind ¶
HintKind classifies what to change for a filesystem Ether cannot fully trust: "unraid", "docker-desktop", "network", "fuse", or "" when there is nothing specific to say. The console translates by kind.
func Kind ¶
Kind is a cheap identity of the filesystem holding dir (one statfs on Unix), for re-checking that it has not changed since Inspect.
func Probe ¶
Probe tests, in a scratch folder inside dir, what the payload store's crash recovery relies on: write and fsync, read back, atomic rename over an existing file, stable and distinct file identity, exclusive locks that a second open file cannot take and that closing releases, in-place rewrite, and remove. nil means every check passed. The scratch folder is removed; one left by a crash is removed by the next probe.
A local probe cannot see another machine, so it never makes a network filesystem trustworthy; callers do not probe those.
func SQLiteUnsafe ¶
SQLiteUnsafe reports why SQLite cannot keep a database consistent on this filesystem, or "" when it can. SQLite needs POSIX locks and the shared memory of its write-ahead log, which network filesystems do not provide reliably; Unraid user shares (fuse.shfs) are the documented source of corrupted app databases on Unraid.
Types ¶
type Info ¶
type Info struct {
Path string
// Type names the filesystem: the mount type from /proc/self/mountinfo
// (fuse.shfs, nfs4, virtiofs), the BSD/macOS type name, the Windows
// volume format, or the statfs magic in hex when nothing names it.
Type string
Class Class
// Kind is the cheap identity Kind returns. A later Kind that differs
// means the folder now lives on another filesystem.
Kind string
}
Info describes the filesystem holding a folder.
type ProbeError ¶
ProbeError names the semantic a filesystem failed.
func (*ProbeError) Error ¶
func (e *ProbeError) Error() string
func (*ProbeError) Unwrap ¶
func (e *ProbeError) Unwrap() error