Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932234AbcCKVuP (ORCPT ); Fri, 11 Mar 2016 16:50:15 -0500 Received: from h2.hallyn.com ([78.46.35.8]:50108 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbcCKVuN (ORCPT ); Fri, 11 Mar 2016 16:50:13 -0500 Date: Fri, 11 Mar 2016 15:50:10 -0600 From: "Serge E. Hallyn" To: Tejun Heo , lkml Subject: cgroup namespaces - mount root Message-ID: <20160311215010.GA5844@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 29 Hi Tejun, 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. I keep waffling between thinking this is a problem that needs to be solved, and thinking "don't do that". But docker at least seems to have a problem with it right now, because it uses that field as part of its calculation of paths to write to. So, do you think it would be worth adding a 'nsroot=' entry in the optional fields (next shared:) ? I would've just sent a patch, but it actually isn't quite as simple as it would seem to find a way to get the absolute path during mountinfo_read(), so I thought I'd ask before spending more time on it. thanks, -serge