netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dmitry Yakunin <zeil@yandex-team.ru>
Cc: dsahern@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next v2] lib: fix checking of returned file handle size for cgroup
Date: Mon, 6 Jul 2020 11:07:05 -0700	[thread overview]
Message-ID: <20200706110705.2d5feb99@hermes.lan> (raw)
In-Reply-To: <20200705161812.45560-1-zeil@yandex-team.ru>

On Sun,  5 Jul 2020 19:18:12 +0300
Dmitry Yakunin <zeil@yandex-team.ru> wrote:

> Before this patch check is happened only in case when we try to find
> cgroup at cgroup2 mount point.
> 
> v2:
>   - add Fixes line before Signed-off-by (David Ahern)
> 
> Fixes: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions")
> Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
> ---
>  lib/fs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/fs.c b/lib/fs.c
> index e265fc0..4b90a70 100644
> --- a/lib/fs.c
> +++ b/lib/fs.c
> @@ -148,10 +148,10 @@ __u64 get_cgroup2_id(const char *path)
>  					strerror(errno));
>  			goto out;
>  		}
> -		if (fhp->handle_bytes != sizeof(__u64)) {
> -			fprintf(stderr, "Invalid size of cgroup2 ID\n");
> -			goto out;
> -		}
> +	}
> +	if (fhp->handle_bytes != sizeof(__u64)) {
> +		fprintf(stderr, "Invalid size of cgroup2 ID\n");
> +		goto out;
>  	}
>  
>  	memcpy(cg_id.bytes, fhp->f_handle, sizeof(__u64));

Applied, thanks.

      reply	other threads:[~2020-07-06 18:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 16:18 [PATCH iproute2-next v2] lib: fix checking of returned file handle size for cgroup Dmitry Yakunin
2020-07-06 18:07 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200706110705.2d5feb99@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=zeil@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).