Messages in this thread Patch in this message | | | From | 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 |
| |
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 <seth.forshee@canonical.com> --- 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 <linux/ctype.h> #include <linux/genhd.h> #include <linux/blktrace_api.h> +#include <linux/user_namesapce.h> #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
| |