[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7Pwfjg4642i1FMG1mKJN58K+nYhqvN_NnrbQ+uiPXibGQ@mail.gmail.com>
Date: Wed, 11 Mar 2015 09:38:04 -0700
From: Cong Wang <cwang@...pensource.com>
To: Vadim Kochan <vadim4j@...il.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: iproute2: ip netns: Do not delete netns if there any process use it
On Wed, Mar 11, 2015 at 12:40 AM, Vadim Kochan <vadim4j@...il.com> wrote:
>
> Hi,
>
> There might be case when it is possible to loose device which was
> moved to netns if there is process which is running is that netns:
>
> $ ip netns add net
> $ ip link set dev eth0 netns net0
> $ ip netns exec net0 SOME_PROCESS_IN_BACKGROUND
> $ ip netns del net0
>
> so eth0 will not appear in the default netns until SOME_PROCESS_IN_BACKGROUND will exit or
> will ne killed. So to avoid such case it might be better to do not
> delete netns if there are process in it ? I meant add such validation
> for 'ip netns del' command.
No, kernel does all the reference counting, no need to bother iproute2.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists