diff mbox

brd: Re-instate ram disk visibility option (part_show)

Message ID 54EED5F6.2030804@plexistor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boaz Harrosh Feb. 26, 2015, 8:14 a.m. UTC
This re-enables part_show option, so we can keep it false by
default.

Here is what Dmitry said in the original patch:
  [aeac318] brd: add ram disk visibility option
	Currently ram disk is not visible inside /proc/partitions.
	This was done for compatibility reasons here: 53978d0a7a27.
	But some utilities expect disk presents in /proc/partitions.
	Let's add module's option and let's administrator chose
	visibility behavior. By default, old behavior preserved.

Dave Chinner and other have reported problems with current system
when udev events start firing for ramdisk:
	http://marc.info/?l=linux-fsdevel&m=142490357918672&w=2

It was me who enabled these notifications through this patch:
   [937af5e] brd: Fix all partitions BUGs
Sorry for the mess.

CC: Dave Chinner <david@fromorbit.com>
CC: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Boaz Harrosh <boaz@plexistor.com>
---
 drivers/block/brd.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 64ab495..6e0775b 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -450,6 +450,10 @@  static int max_part = 1;
 module_param(max_part, int, S_IRUGO);
 MODULE_PARM_DESC(max_part, "Num Minors to reserve between devices");
 
+static int part_show = 0;
+module_param(part_show, int, S_IRUGO);
+MODULE_PARM_DESC(part_show, "Control RAM disk visibility in /proc/partitions");
+
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_BLOCKDEV_MAJOR(RAMDISK_MAJOR);
 MODULE_ALIAS("rd");
@@ -513,6 +517,8 @@  static struct brd_device *brd_alloc(int i)
 	disk->private_data	= brd;
 	disk->queue		= brd->brd_queue;
 	disk->flags		= GENHD_FL_EXT_DEVT;
+	if (!part_show)
+		disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
 	sprintf(disk->disk_name, "ram%d", i);
 	set_capacity(disk, rd_size * 2);