Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754794AbcC3S62 (ORCPT ); Wed, 30 Mar 2016 14:58:28 -0400 Received: from mail-yw0-f173.google.com ([209.85.161.173]:33050 "EHLO mail-yw0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbcC3S60 (ORCPT ); Wed, 30 Mar 2016 14:58:26 -0400 Date: Wed, 30 Mar 2016 14:58:24 -0400 From: Tejun Heo To: "Serge E. Hallyn" Cc: linux-api@vger.kernel.org, adityakali@google.com, Linux Containers , "Eric W. Biederman" , cgroups@vger.kernel.org, lkml Subject: Re: [RFC PATCH] cgroup namespaces: add a 'nsroot=' mountinfo field Message-ID: <20160330185824.GR7822@mtj.duckdns.org> References: <20160321234133.GA22463@mail.hallyn.com> <20160329011203.GA8974@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160329011203.GA8974@mail.hallyn.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1212 Lines: 32 Hello, Serge. On Mon, Mar 28, 2016 at 08:12:03PM -0500, Serge E. Hallyn wrote: > Quoting Serge E. Hallyn (serge@hallyn.com): > > One practical problem I've found with cgroup namespaces is that there > > is no way to disambiguate between a cgroupfs mount which was done in > > a cgroup namespace, and a bind mount of a cgroupfs directory. So > > whether I do > > > > unshare --cgroup -- bash -c "mount -t cgroup -o freezer f /mnt; cat /proc/self/mountinfo" > > > > or whether I just > > > > mount --bind /sys/fs/cgroup/freezer/$(awk -F: '/freezer/ { print $3 }' /proc/self/cgroup) /mnt > > > > 'mount root' field (field 3) in /proc/self/mountinfo will show the > > same thing, the result of awk -F: '/freezer/ { print $3 }' /proc/self/cgroup. > > > > This patch adds a 'nsroot=' field to cgroup mountinfo entries, so that > > userspace can distinguish a mount made in a cgroup namespace from a bind > > mount from a cgroup subdirectory. > > no rush on the patch itself, I don't mind if i have to rewrite it from > scratch, but I'd like to get the patch into docker/libcontainer using it, > so can we decide on whether the syntax as shown here is ok? Yeah, I think the syntax is fine. Thanks. -- tejun