Commit 18ede23c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

inotify: Tune up fdinfo format for new kernel output

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent eeb8f763
...@@ -116,6 +116,7 @@ struct inotify_wd_entry { ...@@ -116,6 +116,7 @@ struct inotify_wd_entry {
u32 id; u32 id;
u64 i_ino; u64 i_ino;
u32 mask; u32 mask;
u32 ignored_mask;
u32 s_dev; u32 s_dev;
u32 wd; u32 wd;
fh_t f_handle; fh_t f_handle;
......
...@@ -67,9 +67,10 @@ void show_inotify_wd(int fd_inotify_wd, struct cr_options *o) ...@@ -67,9 +67,10 @@ void show_inotify_wd(int fd_inotify_wd, struct cr_options *o)
if (ret <= 0) if (ret <= 0)
goto out; goto out;
pr_msg("inotify-wd: id 0x%08x 0x%08x s_dev 0x%08x i_ino 0x%016lx mask 0x%08x " pr_msg("inotify-wd: id 0x%08x 0x%08x s_dev 0x%08x i_ino 0x%016lx "
" mask 0x%08x ignored_mask 0x%08x "
"[fhandle] 0x%08x 0x%08x 0x%016lx:0x%016lx ...\n", "[fhandle] 0x%08x 0x%08x 0x%016lx:0x%016lx ...\n",
e.id, e.wd, e.s_dev, e.i_ino, e.mask, e.id, e.wd, e.s_dev, e.i_ino, e.mask, e.ignored_mask,
e.f_handle.bytes, e.f_handle.type, e.f_handle.bytes, e.f_handle.type,
e.f_handle.__handle[0], e.f_handle.__handle[0],
e.f_handle.__handle[1]); e.f_handle.__handle[1]);
...@@ -166,7 +167,7 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p) ...@@ -166,7 +167,7 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
if (write_img(image_fd, &ie)) if (write_img(image_fd, &ie))
goto err; goto err;
pos = strstr(fdinfo_buf, "wd:"); pos = strstr(fdinfo_buf, "inotify wd:");
if (!pos) if (!pos)
return 0; return 0;
...@@ -174,11 +175,12 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p) ...@@ -174,11 +175,12 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
while (tok) { while (tok) {
pr_debug("Line: `%s'\n", tok); pr_debug("Line: `%s'\n", tok);
ret = sscanf(tok, ret = sscanf(tok,
"wd: %8d ino: %16lx, sdev: %8x mask %8x " "inotify wd: %8d ino: %16lx sdev: %8x "
"fhandle-bytes: %8x fhandle-type: %8x f_handle: ", "mask: %8x ignored_mask: %8x fhandle-bytes: %8x "
&we.wd, &we.i_ino, &we.s_dev, &we.mask, "fhandle-type: %8x f_handle: ",
&we.wd, &we.i_ino, &we.s_dev, &we.mask, &we.ignored_mask,
&we.f_handle.bytes, &we.f_handle.type); &we.f_handle.bytes, &we.f_handle.type);
if (ret != 6) { if (ret != 7) {
pr_err("Inotify fdinfo format mismatch #%d\n", ret); pr_err("Inotify fdinfo format mismatch #%d\n", ret);
goto parse_error; goto parse_error;
} }
...@@ -207,6 +209,7 @@ err: ...@@ -207,6 +209,7 @@ err:
return ret; return ret;
parse_error: parse_error:
ret = -1;
pr_err("Incorrect format in inotify fdinfo %d (%d)\n", p->fd, lfd); pr_err("Incorrect format in inotify fdinfo %d (%d)\n", p->fd, lfd);
goto err; goto err;
} }
......
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