summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-10-25 14:53:27 +0300
committerJens Axboe <axboe@fb.com>2016-10-25 20:55:23 +0300
commit366f4aea649a65c3735d91b4409d84c771811290 (patch)
tree0c8e3977ec113b0caeabdb42d290c2f06480504f
parent5f2808ff1582202175d3908973eb9e05a5e6625d (diff)
downloadlinux-366f4aea649a65c3735d91b4409d84c771811290.tar.xz
brd: Switch rd_size to unsigned long
Currently rd_size was int which lead to overflow and bogus device size once the requested ramdisk size was 1 TB or more. Although these days ramdisks with 1 TB size are mostly a mistake, the days when they are useful are not far. Reported-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/block/brd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 0c76d4016eeb..9d5335857191 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -443,8 +443,8 @@ static int rd_nr = CONFIG_BLK_DEV_RAM_COUNT;
module_param(rd_nr, int, S_IRUGO);
MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
-int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
-module_param(rd_size, int, S_IRUGO);
+unsigned long rd_size = CONFIG_BLK_DEV_RAM_SIZE;
+module_param(rd_size, ulong, S_IRUGO);
MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
static int max_part = 1;