<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/index.php?action=history&amp;feed=atom&amp;title=Mounts-v2-Virtuozzo</id>
	<title>Mounts-v2-Virtuozzo - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/index.php?action=history&amp;feed=atom&amp;title=Mounts-v2-Virtuozzo"/>
	<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;action=history"/>
	<updated>2026-05-13T14:56:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5219&amp;oldid=prev</id>
		<title>Ptikhomirov: Ptikhomirov moved page Mounts-v2 to Mounts-v2-Virtuozzo: Need a place for a Mount-v2 description for a changed ported version.</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5219&amp;oldid=prev"/>
		<updated>2022-01-25T15:19:00Z</updated>

		<summary type="html">&lt;p&gt;Ptikhomirov moved page &lt;a href=&quot;/Mounts-v2&quot; class=&quot;mw-redirect&quot; title=&quot;Mounts-v2&quot;&gt;Mounts-v2&lt;/a&gt; to &lt;a href=&quot;/Mounts-v2-Virtuozzo&quot; title=&quot;Mounts-v2-Virtuozzo&quot;&gt;Mounts-v2-Virtuozzo&lt;/a&gt;: Need a place for a Mount-v2 description for a changed ported version.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:19, 25 January 2022&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key criuwikidb:diff::1.12:old-5082:rev-5219 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ptikhomirov</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5082&amp;oldid=prev</id>
		<title>Ptikhomirov: Add category.</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5082&amp;oldid=prev"/>
		<updated>2020-08-21T08:49:39Z</updated>

		<summary type="html">&lt;p&gt;Add category.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:49, 21 August 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot; &gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Delayed proc part: https://src.openvz.org/projects/OVZ/repos/criu/commits?until=v3.12.5.13&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Delayed proc part: https://src.openvz.org/projects/OVZ/repos/criu/commits?until=v3.12.5.13&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Kernel patch for MS_SET_GROUP: https://lore.kernel.org/lkml/1485214628-23812-1-git-send-email-avagin@openvz.org/&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Kernel patch for MS_SET_GROUP: https://lore.kernel.org/lkml/1485214628-23812-1-git-send-email-avagin@openvz.org/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Under the hood]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key criuwikidb:diff::1.12:old-5081:rev-5082 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ptikhomirov</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5081&amp;oldid=prev</id>
		<title>Ptikhomirov: Design of mounts-v2 engine</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Mounts-v2-Virtuozzo&amp;diff=5081&amp;oldid=prev"/>
		<updated>2020-08-21T08:28:12Z</updated>

		<summary type="html">&lt;p&gt;Design of mounts-v2 engine&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mounts v2 CRIU algorithm&lt;br /&gt;
&lt;br /&gt;
This algorithm is designed to overcome problems with sharing group restore, overmounted files, mounts with namespace tags and some more smaller problems.&lt;br /&gt;
&lt;br /&gt;
(assume single userns for now)&lt;br /&gt;
&lt;br /&gt;
* Mounts image read stage (read_mnt_ns_img + read_mnt_ns_img_v2)&lt;br /&gt;
** Read mount_infos from images for each mount namespace to lists (collect_mnt_from_image)&lt;br /&gt;
** Put mounts to trees for each mount namespace (mnt_build_tree)&lt;br /&gt;
** Group mounts by superblock equality into &amp;quot;bind&amp;quot; lists (search_bindmounts)&lt;br /&gt;
** Prepare sharing groups&lt;br /&gt;
*** Group mounts into shared group by equality of (master_id + shared_id)&lt;br /&gt;
*** Put shared groups in tree where parent-&amp;gt;shared_id == child-&amp;gt;master_id&lt;br /&gt;
*** If two groups has same master_id, make them siblings (even if no parent)&lt;br /&gt;
** Prepare &amp;quot;internal yard&amp;quot; mount_info aside (setup_internal_yards)&lt;br /&gt;
*** ns mountpoint &amp;quot;/internal-yard-XXXXXX&amp;quot;&lt;br /&gt;
*** will require writable namespace root mount&lt;br /&gt;
*** needed for mount stage after forking tasks&lt;br /&gt;
** Prepare nested pidns procfses &lt;br /&gt;
*** Copy namespace tag across &amp;quot;bind&amp;quot; list (search_nested_pidns_proc)&lt;br /&gt;
*** Create helpers for descendants of nested pidns procfses in &amp;quot;internal yard&amp;quot; (handle_nested_pidns_proc)&lt;br /&gt;
**** These helpers get root &amp;quot;/&amp;quot; for simplicity (deleted, file/dir)&lt;br /&gt;
***** no nsfs bind support&lt;br /&gt;
**** ns mountpoint &amp;quot;/internal-yard-XXXXXX/hlp-[mnt_id]&lt;br /&gt;
** Prepare &amp;quot;root yard&amp;quot;&lt;br /&gt;
*** helper mount with mountpoint &amp;quot;/tmp/.criu.mntns.XXXXXX/&amp;quot;&lt;br /&gt;
*** Merge mount trees of all mount namespaces as subdirectories of &amp;quot;root yard&amp;quot; (merge_mount_trees)&lt;br /&gt;
**** mountpoint &amp;quot;/tmp/.criu.mntns.XXXXXX/[nns_id]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Mounting, first stage (before forking processes) from init task in &amp;quot;service&amp;quot; mntns (prepare_mnt_ns_v2)&lt;br /&gt;
** Actually create and mount &amp;quot;root yard&amp;quot; (populate_mnt_ns_v2 -&amp;gt; populate_roots_yard_v2)&lt;br /&gt;
** Replace mounts for after forking tasks stage (insert_internal_yards)&lt;br /&gt;
*** Delete nested pidns procfses from tree&lt;br /&gt;
*** Insert internal yards with helpers to tree&lt;br /&gt;
** Walk the merged mount tree (mnt_tree_for_each) parents before children&lt;br /&gt;
*** Mount all mounts &amp;quot;plain&amp;quot; (do_mount_one_v2)&lt;br /&gt;
**** check mount can be mounted (can_mount_now_v2) e.g. for overlay, root, external, bind or nsfs&lt;br /&gt;
**** create mountpoint &amp;quot;/tmp/.criu.mntns.XXXXXX/mnt-[mnt_id]&amp;quot; (create_plain_mountpoint)&lt;br /&gt;
***** dir/file detected by stat on mountpoint&lt;br /&gt;
**** Mount all mounts private and &amp;quot;plain&amp;quot;&lt;br /&gt;
***** just mount a new mount (do_new_mount_v2)&lt;br /&gt;
****** setup as bind source for other mounts of this super block (propagate_mount_v2)&lt;br /&gt;
***** bind if superblock is already mounted or external or root (do_bind_mount_v2, do_mount_root_v2)&lt;br /&gt;
****** create sources for &amp;quot;deleted&amp;quot; bind mounts and leave it for now&lt;br /&gt;
***** Handle internal yard (do_internal_yard_mount_v2)&lt;br /&gt;
****** mount tmpfs&lt;br /&gt;
****** create mountpoints for children&lt;br /&gt;
****** mount host's proc helper mount inside&lt;br /&gt;
**** Exept for &amp;quot;plain&amp;quot;, &amp;quot;private&amp;quot; and helpers from &amp;quot;internal yard&amp;quot; we restore each mount as it should be in the final mountns (all flags and options applied)&lt;br /&gt;
*** This mounting all the mounts from all final mount namespaces in a single service mount namespace allows us to do &amp;quot;cross-namespace&amp;quot; bindmounts&lt;br /&gt;
&lt;br /&gt;
* Mounting, second stage (&amp;quot;plain&amp;quot; to &amp;quot;tree&amp;quot; mount) (prepare_mnt_ns_v2)&lt;br /&gt;
** Walk across all mount namespaces&lt;br /&gt;
*** unshare(CLONE_NEWNS)&lt;br /&gt;
*** Walk all mounts belonging to this mntns (tree order) (assemble_tree_from_plain_mounts)&lt;br /&gt;
**** mountpoint &amp;quot;/tmp/.criu.mntns.XXXXXX/[nns_id]/[ns_mountpoint]&amp;quot;&lt;br /&gt;
**** Open mountpoint fd before moving mount to it and save (mp_fd)&lt;br /&gt;
**** Move (MS_MOVE) mount to the tree&lt;br /&gt;
**** Open mount fd (root dentry on a mount) (mnt_fd)&lt;br /&gt;
*** Pivot root to &amp;quot;&amp;quot;/tmp/.criu.mntns.XXXXXX/[nns_id]&amp;quot;&lt;br /&gt;
**** leaving only mounts which should be in this mntns&lt;br /&gt;
** Extract &amp;quot;internal yard&amp;quot;s from the tree and put back procfses and their ancestors (extract_internal_yards)&lt;br /&gt;
** Remove sources of deleted mounts making them really &amp;quot;deleted&amp;quot; from &amp;quot;service&amp;quot; mntns (remove_sources_of_deleted_mounts)&lt;br /&gt;
&lt;br /&gt;
* Forking stage: fork all processes (tree order)&lt;br /&gt;
** Inits also creat pid namespaces&lt;br /&gt;
** Enter mount namespace&lt;br /&gt;
** Mmap files from mounted filesystem to restore COW mappings&lt;br /&gt;
*** We assume here that we don't have file mappings on delayed mounts else we can't handle it&lt;br /&gt;
*** Ghost/Link remaps may be created here&lt;br /&gt;
** Fork children&lt;br /&gt;
&lt;br /&gt;
* Mounting, third stage (after forking processes) (from main criu task) (__fini_restore_mntns_v2)&lt;br /&gt;
** Enter CT userns (fini_restore_mntns_v2)&lt;br /&gt;
** For each mount namespace&lt;br /&gt;
*** For each procfs of this mntns (fixup_nested_pidns_proc)&lt;br /&gt;
**** Enter tagged pidns&lt;br /&gt;
**** Mount procfs from it in &amp;quot;internal yard&amp;quot;&lt;br /&gt;
*** Walk the mount tree of each mntns and mount all yet not mounted mounts to the tree&lt;br /&gt;
**** Find the mountpoint for the mount via mnt_fd of parent and mp_fds of sibling overmounts&lt;br /&gt;
**** Bind the mount to it from the internal yard helper or procfs helper&lt;br /&gt;
***** via /proc/self/fd/&amp;lt;id&amp;gt; on hosts proc in &amp;quot;internal yard&amp;quot;&lt;br /&gt;
**** Also open mnt_fd and mp_fd for a new mount (before and after bind)&lt;br /&gt;
*** Umount and rmdir &amp;quot;internal yard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* And finally&lt;br /&gt;
** Restore sharing groups for each mount (use mnt_fd to access mounts) (restore_mount_sharing_options)&lt;br /&gt;
*** Walk sharing group trees (parents before children)&lt;br /&gt;
**** Setup first (any) mount in a group&lt;br /&gt;
***** Is slave&lt;br /&gt;
****** Find any mount from parent sg or find external mount source&lt;br /&gt;
****** Copy sharing from it with MS_SET_GROUP&lt;br /&gt;
****** Make slave&lt;br /&gt;
***** Is shared - make it also shared&lt;br /&gt;
**** Setup other mounts - copy sharing from the first one&lt;br /&gt;
&lt;br /&gt;
* Done&lt;br /&gt;
&lt;br /&gt;
Here are links to mounts-v2 implementation in Virtuozzo criu:&lt;br /&gt;
* Main part: https://src.openvz.org/projects/OVZ/repos/criu/commits?until=v3.12.3.12&lt;br /&gt;
* Delayed proc part: https://src.openvz.org/projects/OVZ/repos/criu/commits?until=v3.12.5.13&lt;br /&gt;
* Kernel patch for MS_SET_GROUP: https://lore.kernel.org/lkml/1485214628-23812-1-git-send-email-avagin@openvz.org/&lt;/div&gt;</summary>
		<author><name>Ptikhomirov</name></author>
	</entry>
</feed>