Difference between revisions of "Mount-v2"

From CRIU
Jump to navigation Jump to search
Line 1: Line 1:
 
Mount-v2 CRIU algorithm
 
Mount-v2 CRIU algorithm
 +
 +
== Introduction ==
  
 
After we've merged MOVE_MOUNT_SET_GROUP feature to mainstream linux v5.15 [https://github.com/torvalds/linux/commit/9ffb14ef61bab83fa818736bf3e7e6b6e182e8e2 torvalds/linux@9ffb14e] now we can use it to restore sharing groups of mounts without the need to care about inheriting those groups when create mounts, we can just set sharing groups at later stage and before that construct mount trees with private mounts.
 
After we've merged MOVE_MOUNT_SET_GROUP feature to mainstream linux v5.15 [https://github.com/torvalds/linux/commit/9ffb14ef61bab83fa818736bf3e7e6b6e182e8e2 torvalds/linux@9ffb14e] now we can use it to restore sharing groups of mounts without the need to care about inheriting those groups when create mounts, we can just set sharing groups at later stage and before that construct mount trees with private mounts.
Line 9: Line 11:
 
* Propagation may change parent mounts for existing mount tree;
 
* Propagation may change parent mounts for existing mount tree;
 
* "Mount trap" - propagation may cover initial mount;
 
* "Mount trap" - propagation may cover initial mount;
* "Non-uniform" propagation - there are different tricks with mount order and temporary children-"lock" mounts, which create mount trees which can't be restored without those tricks.
+
* "Non-uniform" propagation - there are different tricks with mount order and temporary children-"lock" mounts, which create mount trees which can't be restored without those tricks;
* "Cross-namespace" sharing groups creation need to be ordered with mount namespace creation right.
+
* "Cross-namespace" sharing groups creation need to be ordered with mount namespace creation right;
 
* Sharing groups vs mount tree order inversion can be very complex to restore and require multiple auxiliary. (see example below)
 
* Sharing groups vs mount tree order inversion can be very complex to restore and require multiple auxiliary. (see example below)
  

Revision as of 07:17, 26 January 2022

Mount-v2 CRIU algorithm

Introduction

After we've merged MOVE_MOUNT_SET_GROUP feature to mainstream linux v5.15 torvalds/linux@9ffb14e now we can use it to restore sharing groups of mounts without the need to care about inheriting those groups when create mounts, we can just set sharing groups at later stage and before that construct mount trees with private mounts.

Restoring propagation right with conservative approach of both creating mounts and inheriting propagation groups looks like mission impossible task for us due to many problems:

  • Criu knows nothing about the initial history or order of mount tree creation;
  • Propagation can create tons of mounts;
  • Propagation may change parent mounts for existing mount tree;
  • "Mount trap" - propagation may cover initial mount;
  • "Non-uniform" propagation - there are different tricks with mount order and temporary children-"lock" mounts, which create mount trees which can't be restored without those tricks;
  • "Cross-namespace" sharing groups creation need to be ordered with mount namespace creation right;
  • Sharing groups vs mount tree order inversion can be very complex to restore and require multiple auxiliary. (see example below)

See my talks about it on Linux Plumbers Conference:

And here is the example of order inversion where multiple temporary mounts needed to achieve the result:

Mounts-inverse-order-example.gif

to be continued...