[Devel] [PATCH RH7 0/2] proc/mounts: fix missing mounts in mountinfo

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Mar 2 11:37:57 MSK 2021


We see a race when reading mountinfo from criu line-by-line. When we
read mountinfo line-by-line and some mounts which were already printed
were umounted before printing next mounts we can see some of next mounts
skipped from output (consequent cat /proc/<pid>/mountinfo shows them).
This leads to situations where the mount tree is inconsistend without
those missing mounts and criu fails.

So mountinfo printing based on numeric position in mounts list is racy.
We can switch to new mainstream approach witch adds mountinfo "cursor"
to mount namespace mounts list so that even if some mounts are deleted
from the list, we can still continue reading next mounts after "cursor"
consistently.

https://jira.sw.ru/browse/PSBM-125812
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

Miklos Szeredi (1):
  proc/mounts: add cursor

Pavel Begunkov (1):
  list: introduce list_for_each_continue()

 fs/mount.h            | 16 ++++++--
 fs/namespace.c        | 91 +++++++++++++++++++++++++++++++++++--------
 fs/proc_namespace.c   |  4 +-
 fs/sync.c             |  5 +++
 include/linux/list.h  | 10 +++++
 include/linux/mount.h |  4 +-
 6 files changed, 109 insertions(+), 21 deletions(-)

-- 
2.26.2



More information about the Devel mailing list