Remove the 'unmount at switch' optional feature 69/324669/2
authorMichal Bloch <m.bloch@samsung.com>
Thu, 22 May 2025 11:38:32 +0000 (13:38 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Thu, 22 May 2025 14:03:29 +0000 (16:03 +0200)
Keeping sessions mounted is mandatory for sessiond
to work correctly, the macro was dangerous.

Change-Id: Ib0c0466848f88909eaa0f5e837356d39cfca83cd

src/service/src/dir_backend_fixed_size.cpp

index 9bf05a14eebb9f55a81d35215082c95956b14dfc..f564a0714fd626ad0d54ad3ed938bbdec34a863b 100644 (file)
@@ -137,14 +137,19 @@ void DirBackendFixedSize::RemoveSubsession (const fs::path& subsession_path) con
 
 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