From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753598AbaENVg4 (ORCPT ); Wed, 14 May 2014 17:36:56 -0400 Received: from mail-oa0-f50.google.com ([209.85.219.50]:63595 "EHLO mail-oa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbaENVfV (ORCPT ); Wed, 14 May 2014 17:35:21 -0400 From: Seth Forshee To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jens Axboe , Arnd Bergmann , Eric Biederman , Serge Hallyn , lxc-devel@lists.linuxcontainers.org, Seth Forshee Subject: [RFC PATCH 07/11] block: Make partitions inherit namespace from whole disk device Date: Wed, 14 May 2014 16:34:55 -0500 Message-Id: <1400103299-144589-8-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400103299-144589-1-git-send-email-seth.forshee@canonical.com> References: <1400103299-144589-1-git-send-email-seth.forshee@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When adding block devices for paritions the devices default to ownership by init_user_ns. Instead assign them to the same namespace as the device for the whole disk. Signed-off-by: Seth Forshee --- block/partition-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/partition-generic.c b/block/partition-generic.c index 789cdea05893..7c1c83a072a6 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "partitions/check.h" @@ -325,6 +326,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, pdev->class = &block_class; pdev->type = &part_type; pdev->parent = ddev; + dev_set_ns(pdev, ddev->ns); err = blk_alloc_devt(p, &devt); if (err) -- 1.9.1