Projects STRLCPY criu Commits 88fbd37f
🤬
  • criu: Don't fail if ghost file has no parent dirs.

    Due to way CRIU handles paths (as relative to workdir), there's a case,
    where migration would fail. Simple example is a ghost file in filesystem
    root (with root being cwd). For example, "/unlinked" becomes "unlinked".
    And original code piece scans path for other slashes, which would be
    missing in this case. But it's still a perfectly valid case, and there's
    no need to fail. So if there's no parent dir - we just don't need to
    create one and we can just return 0 here instead of failing.
    
    Signed-off-by: Vitaly Ostrosablin <[email protected]>
    Signed-off-by: Andrei Vagin <[email protected]>
  • Loading...
  • Vitaly Ostrosablin committed with Andrei Vagin 6 years ago
    88fbd37f
    1 parent 8720f1da
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    criu/files-reg.c
    skipped 1473 lines
    1474 1474   struct stat st;
    1475 1475   
    1476 1476   p = last_delim = strrchr(path, '/');
    1477  - if (!p) {
    1478  - pr_err("Path %s has no parent dir\n", path);
    1479  - return -1;
    1480  - }
     1477 + if (!p)
     1478 + return 0;
    1481 1479   *p = '\0';
    1482 1480   
    1483 1481   if (fstatat(mntns_root, path, &st, AT_EMPTY_PATH) == 0)
    skipped 478 lines
Please wait...
Page is in error, reload to recover