From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [iproute PATCH] lib/namespace: avoid double-mounting a /sys Date: Fri, 27 Jul 2018 13:45:05 -0700 Message-ID: <20180727134505.4065994f@xeon-e3> References: <20180724172638.760873-1-lkundrak@v3.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Phil Sutter To: Lubomir Rintel Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:33602 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731012AbeG0WIm (ORCPT ); Fri, 27 Jul 2018 18:08:42 -0400 Received: by mail-pg1-f196.google.com with SMTP id r5-v6so3874263pgv.0 for ; Fri, 27 Jul 2018 13:45:08 -0700 (PDT) In-Reply-To: <20180724172638.760873-1-lkundrak@v3.sk> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 24 Jul 2018 19:26:38 +0200 Lubomir Rintel wrote: > This partly reverts 8f0807023d067e2bb585a2ae8da93e59689d10f1, bringing > back the umount(/sys) attempt. > > In a LXC container we're unable to umount the sysfs instance, nor mount > a read-write one. We still are able to create a new read-only instance. > > Nevertheless, it still makes sense to attempt the umount() even though > the sysfs is mounted read-only. Otherwise we may end up attempting to > mount a sysfs with the same flags as is already mounted, resulting in > an EBUSY error (meaning "Already mounted"). > > Perhaps this is not a very likely scenario in real world, but we hit > it in NetworkManager test suite and makes netns_switch() somewhat more > robust. It also fixes the case, when /sys wasn't mounted at all. > > Signed-off-by: Lubomir Rintel Makes sens applied.