CPT: fix shmat(2)'ted segments
Commit bc56bba8f31bd99f350a5ebfd43d50f411b620c7 aka
"[PATCH] shm: make sysv ipc shared memory use stacked files"...
It changed number and relationship of "struct file"s associated
with SysV shmem:
Before: one struct file for each shmem segment
After: one struct file for each shmem segment
+ one struct file (different) for each shmat(2) call.
Obviously checkpointing broke horribly. There aren't any files of second sort
in image and they have to be recreated by hand.
What code will do:
a) if CPT_OBJ_SYSV_SHM object restored first -- fine, restore as previous kernels did
b) if CPT_VMA_TYPE_SHM restored first -- restore corresponding segment, then do more
or less similar to what do_shmat() does.
c) if shmem segment already was restored, correct refcounting and just do shmat() part