aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorMarcin Krol <hawk@pld-linux.org>2008-05-23 16:04:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-24 12:56:11 -0400
commit53978d0a7a27eb036b9bf33c4caa06257a9dbed7 (patch)
tree3deb746ef8ee21647985c970c1130325afd90773 /drivers/block/brd.c
parent6089093e588ee3f6aed99d08b1cf5ea37c52cf97 (diff)
brd: don't show ramdisks in /proc/partitions
In 2.6.25, ramdisk devices show up in /proc/partitions, which is a behaviour change from the old rd.c. Add GENHD_FL_SUPPRESS_PARTITION_INFO, which was present in rd.c. All kernels prior to 2.6.25 weren't displaying ramdisks in /proc/partitions. Since there are many userspace tools using information from /proc/partitions some of them may now behave incorrectly (I didn't tested any though). For example before 2.6.25 /proc/partitions was empty if no block devices like hard disks and such were detected by kernel. Now all 16 ramdisks are always visible there. Some software may rely on such information (I mean, on empty /proc/partitions). There was quite similar situation back in 2004, and ramdisks were excluded back from displaying. Thats why I called this a regression (maybe a bit unfortunate). See this patch for info: http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.3-rc2/2.6.3-rc2-mm1/broken-out/nbd-proc-partitions-fix.patch I also think that someone somewhere (long time ago) excluded ramdisks from /proc/partitions for good reasons. It is possible that now such new "feature" is harmless, but I think there are more chances that someone will say "hey, /proc/partitions has changed, now my software doesn't work" then "hey where did my new 2.6.25 feature go". nbd devices are also excluded, maybe for very same (unknown to me) reasons. Signed-off-by: Marcin Krol <hawk@pld-linux.org> Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r--drivers/block/brd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index a196ef7f147f..680cdfc00b90 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -447,6 +447,7 @@ static struct brd_device *brd_alloc(int i)
447 disk->fops = &brd_fops; 447 disk->fops = &brd_fops;
448 disk->private_data = brd; 448 disk->private_data = brd;
449 disk->queue = brd->brd_queue; 449 disk->queue = brd->brd_queue;
450 disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
450 sprintf(disk->disk_name, "ram%d", i); 451 sprintf(disk->disk_name, "ram%d", i);
451 set_capacity(disk, rd_size * 2); 452 set_capacity(disk, rd_size * 2);
452 453