void DirBackendFixedSize::SwitchSubsessionAway (const fs::path& subsession_path) const
{
-#ifdef SESSIOND_UNMOUNT_SESSION_ON_SWITCH
- LOGI("Unmouting session image at %s", subsession_path.c_str());
- OS::do_umount(subsession_path);
-#else
- /* By default, keep subsession mounted for reuse in case it is switched to again.
- * Addionally, this leaves subsession in the same state across sessiond restarts. */
- LOGI("Switching away from subsession but keeping image mounted at %s", subsession_path.c_str());
-#endif
+ /* Keeping subsession mounted:
+ *
+ * - leaves the subsession's contents accessible, which means it's
+ * consistent with how regular dir backend works
+ *
+ * - in particular, is mandatory so that external updates (e.g. when a
+ * package is installed) can correctly update all existing subsessions
+ *
+ * - makes it faster to switch back to this subsession later
+ *
+ * - makes it a bit more robust in case sessiond dies/restarts
+ */
+ LOGI("Switching away from subsession but keeping image mounted at %s", subsession_path.c_str());
}
void DirBackendFixedSize::SwitchSubsessionInto (const fs::path& subsession_path) const