]> git.hungrycats.org Git - bees/commitdiff
state: drop reference to missing snapshot feature on kernels too old to use
authorZygo Blaxell <bees@furryterror.org>
Mon, 3 Aug 2026 06:15:59 +0000 (02:15 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 5 Sep 2026 04:03:58 +0000 (00:03 -0400)
The Linux kernel version cutoff is 5.4 (soon to be 5.10).  The snapshot
ioctl is far older.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
docs/config-file.md
src/bees-context.cc

index f89d0fd8ef6110d010a320136302622f728e5a3a..ce58ee9e6a52826cb121b17c919e40aeb056480d 100644 (file)
@@ -437,11 +437,10 @@ files in detail.
     if it is missing.  It first attempts `BTRFS_IOC_SUBVOL_CREATE` so
     `path.home` becomes its own subvolume, with independent
     snapshot/quota lifecycle from the surrounding filesystem.  On a
-    non-btrfs parent (or older kernels that reject the ioctl) it falls
-    back to a plain `mkdir()`.  Only the final path component is
-    created — the parent of `path.home` must already exist.  Once
-    `path.home` exists, `beeshash.dat` is created on first run, sized
-    to `state.hash.size`.
+    non-btrfs parent it falls back to a plain `mkdir()`.  Only the
+    final path component is created — the parent of `path.home` must
+    already exist.  Once `path.home` exists, `beeshash.dat` is created
+    on first run, sized to `state.hash.size`.
   * `no` — startup fails if `path.home` or `beeshash.dat` is missing.
     Useful to detect a misconfigured `path.home` before bees writes a
     fresh empty hash table to the wrong location.
index 307e818d1c5ec431a85454ef032c6e07215678f3..e6df88e4e023d44290bdaa8bf3a7bd48eccc13ed 100644 (file)
@@ -127,7 +127,7 @@ BeesContext::home_fd()
 
        const bool absolute = (home_dir.at(0) == '/');
 
-       // First attempt: open paths.home if it already exists.
+       // First attempt: open path.home if it already exists.
        // Absolute paths use plain openat (dirfd is ignored for absolute
        // paths, symlinks are allowed); relative paths use bees_openat,
        // which tries openat2(RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS |
@@ -152,19 +152,19 @@ BeesContext::home_fd()
        m_home_fd = try_open(open_errno);
        if (!m_home_fd && open_errno == ENOENT) {
                if (!persistent) {
-                       // state.persistent=no: paths.home is optional.  Run
+                       // state.persistent=no: path.home is optional.  Run
                        // inert: BeesStringFile reads return "" and writes
                        // no-op when m_dir_fd is empty.  Logged once at
                        // INFO so it's audible without paying every reconnect.
-                       BEESLOGINFO("paths.home '" << home_dir << "' does not exist; running inert (state.persistent=no)");
+                       BEESLOGINFO("path.home '" << home_dir << "' does not exist; running inert (state.persistent=no)");
                        return m_home_fd;
                }
                if (!create) {
-                       THROW_ERROR(runtime_error, "paths.home '" << home_dir << "' does not exist and state.create=no");
+                       THROW_ERROR(runtime_error, "path.home '" << home_dir << "' does not exist and state.create=no");
                }
 
-               // state.persistent=yes && state.create=yes: create paths.home.
-               // Try BTRFS_IOC_SUBVOL_CREATE first (so paths.home is its own
+               // state.persistent=yes && state.create=yes: create path.home.
+               // Try BTRFS_IOC_SUBVOL_CREATE first (so path.home is its own
                // subvolume with independent snapshot/quota lifecycle), then
                // fall back to mkdir().  Subvol creation only applies when the
                // parent is root_fd() and the name is a single path component;
@@ -173,11 +173,11 @@ BeesContext::home_fd()
                const bool single_component = !absolute && home_dir.find('/') == string::npos;
                bool created = false;
                if (single_component) {
-                       BEESLOGINFO("paths.home '" << home_dir << "' missing; creating subvolume");
+                       BEESLOGINFO("path.home '" << home_dir << "' missing; creating subvolume");
                        created = btrfs_subvol_create_at(root_fd(), home_dir);
                }
                if (!created) {
-                       BEESLOGINFO("paths.home '" << home_dir << "' missing; creating directory");
+                       BEESLOGINFO("path.home '" << home_dir << "' missing; creating directory");
                        const int mkdir_rv = absolute
                                ? mkdir(home_dir.c_str(), 0700)
                                : mkdirat(root_fd(), home_dir.c_str(), 0700);
@@ -185,7 +185,7 @@ BeesContext::home_fd()
                                THROW_ERRNO("mkdir: " << home_dir);
                        }
                }
-               // Retry the open now that paths.home exists.
+               // Retry the open now that path.home exists.
                m_home_fd = try_open(open_errno);
                if (!m_home_fd) {
                        errno = open_errno;