From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754693AbcEXW6I (ORCPT ); Tue, 24 May 2016 18:58:08 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:36225 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbcEXW6G (ORCPT ); Tue, 24 May 2016 18:58:06 -0400 Subject: Re: Mount namespace "dominant peer group"? To: Miklos Szeredi References: <20160520231512.GA9481@ram.oc3035372033.ibm.com> <7a07c930-215b-bdcd-3b08-a5c12cffcfe3@gmail.com> Cc: mtk.manpages@gmail.com, Ram Pai , lkml , "Serge E. Hallyn" , Al Viro From: "Michael Kerrisk (man-pages)" Message-ID: Date: Tue, 24 May 2016 17:57:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/23/2016 02:55 AM, Miklos Szeredi wrote: > C is slave of B is slave of A. If a process can see (i.e. has under > its root) A and C but not B then for C it will show > master:B,propagate_from:A. This piece of information is shown because > it can't see the immediate master (B) and so cannot determine the > chain of propagation between the mounts it can see. Thanks, Miklos! > Concrete example: Yep, that does it. Thanks for the walk through! One piece missing below though, in case anyone else tries to walk through. > # mount --bind / /mnt > # mount --bind /proc /mnt/proc > # mount --make-private /mnt > # mount --make-shared /mnt > # mkdir /tmp/etc > # mount --bind /mnt/etc /tmp/etc > # mount --make-slave /tmp/etc > # mount --make-shared /tmp/etc # mkdir /mnt/tmp/etc > # mount --bind /tmp/etc /mnt/tmp/etc > # mount --make-slave /mnt/tmp/etc > # cat /proc/self/mountinfo | grep /tmp/etc > 164 40 253:1 /etc /tmp/etc rw,relatime shared:100 master:97 - ... > # chroot /mnt > # cat /proc/self/mountinfo > 129 62 253:1 / / rw,relatime shared:97 - ... > 168 129 253:1 /etc /tmp/etc rw,relatime master:100 propagate_from:97 - ... Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/