Commit 2bf23149 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

files: Correctly handle tasks with no open file descriptors

Do not fail, if task doesn't have open files. This fixes
zdtm/static/fd test, which is broken now:

(00.004411) Error (cr-dump.c:1312): Dump files (pid: 25) failed with -1
(00.004548) Error (cr-dump.c:1614): Dumping FAILED.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent cabfbbef
...@@ -481,6 +481,7 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item, ...@@ -481,6 +481,7 @@ int dump_task_files_seized(struct parasite_ctl *ctl, struct pstree_item *item,
if (!img) if (!img)
goto err; goto err;
ret = 0; /* Don't fail if nr_fds == 0 */
for (off = 0; off < dfds->nr_fds; off += nr_fds) { for (off = 0; off < dfds->nr_fds; off += nr_fds) {
if (nr_fds + off > dfds->nr_fds) if (nr_fds + off > dfds->nr_fds)
nr_fds = dfds->nr_fds - off; nr_fds = dfds->nr_fds - off;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment