[CRIU] [PATCH] net/sysctl: silence read error in case of CTL_FLAGS_READ_EIO_SKIP
Tycho Andersen
tycho.andersen at canonical.com
Fri May 20 10:35:03 PDT 2016
On Wed, May 18, 2016 at 01:19:23PM +0300, Pavel Tikhomirov wrote:
> Because stable_secret sysctl c/r produces a lot of spam error messages
> in tests: https://github.com/xemul/criu/issues/160 But EIO for these
> sysctl is valid behavior and no error need to be printed.
>
> More general solution will also silence error messages for
> sysctl_read_{u32,s32,u64}, but the flag CTL_FLAGS_READ_EIO_SKIP is
> now used only for __CTL_STR and only for stable_secret so we can do
> silence error only in sysctl_read_char.
>
> Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Tested-by: Tycho Andersen <tycho.andersen at canonical.com>
Thanks :)
> ---
> criu/sysctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/criu/sysctl.c b/criu/sysctl.c
> index a38fcb8..77d9bda 100644
> --- a/criu/sysctl.c
> +++ b/criu/sysctl.c
> @@ -132,7 +132,8 @@ sysctl_read_char(int fd, struct sysctl_req *req, char *arg, int nr)
> pr_debug("%s nr %d\n", req->name, nr);
> ret = read(fd, arg, nr);
> if (ret < 0) {
> - pr_perror("Can't read %s", req->name);
> + if (errno != EIO || !(req->flags & CTL_FLAGS_READ_EIO_SKIP))
> + pr_perror("Can't read %s", req->name);
> goto err;
> }
> ret = 0;
> --
> 2.5.5
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list