Projects STRLCPY criu Commits e3311ea3
🤬
  • cgroup: Skip unified hier controllers (v2)

    The unified hierarchy controller doesn't have any name, so criu hangs
    while parsing this sort of strings.
    
    Let's skip those for now, until we implement cgroup2 support.
    
    https://github.com/xemul/criu/issues/252
    
    v2: Code comments
    
    Reported-and-tested-by: Adrian Reber <[email protected]>
    Signed-off-by: Pavel Emelyanov <[email protected]>
    Signed-off-by: Andrei Vagin <[email protected]>
  • Loading...
  • Pavel Emelyanov committed 7 years ago
    e3311ea3
    1 parent 3ef5a5e2
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    criu/proc_parse.c
    skipped 2251 lines
    2252 2252   * 2:name=systemd:/user.slice/user-1000.slice/session-1.scope
    2253 2253   */
    2254 2254   name = strchr(buf, ':');
    2255  - if (name)
     2255 + if (name) {
    2256 2256   path = strchr(++name, ':');
     2257 + if (*name == ':') {
     2258 + /*
     2259 + * It's unified hierarchy. On kernels with legacy
     2260 + * tree this item is added automatically, so we
     2261 + * can just skip one. For those with full unified
     2262 + * support is on ... we need to write new code.
     2263 + */
     2264 + xfree(ncc);
     2265 + continue;
     2266 + }
     2267 + }
    2257 2268   if (!name || !path) {
    2258 2269   pr_err("Failed parsing cgroup %s\n", buf);
    2259 2270   xfree(ncc);
    skipped 156 lines
    2416 2427   goto err;
    2417 2428   }
    2418 2429   controllers++;
     2430 + 
     2431 + if (*controllers == ':')
     2432 + /*
     2433 + * Unified hier. See comment in parse_cgroup_file
     2434 + * for more details.
     2435 + */
     2436 + continue;
    2419 2437   
    2420 2438   off = strchr(controllers, ':');
    2421 2439   if (!off) {
    skipped 144 lines
Please wait...
Page is in error, reload to recover