linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] brd: Make rd_size argument static
@ 2016-10-25 11:53 Jan Kara
  2016-10-25 11:53 ` [PATCH 2/2] brd: Switch rd_size to unsigned long Jan Kara
  2016-10-25 14:23 ` [PATCH 1/2] brd: Make rd_size argument static Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kara @ 2016-10-25 11:53 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Bart Van Assche, Jan Kara

rd_size does not appear to be used outside of brd. Make it static.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 drivers/block/brd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 0c76d4016eeb..8b22e4a04918 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -443,7 +443,7 @@ 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;
+static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
 module_param(rd_size, int, S_IRUGO);
 MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
 
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] brd: Switch rd_size to unsigned long
  2016-10-25 11:53 [PATCH 1/2] brd: Make rd_size argument static Jan Kara
@ 2016-10-25 11:53 ` Jan Kara
  2016-10-25 14:23 ` [PATCH 1/2] brd: Make rd_size argument static Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2016-10-25 11:53 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Bart Van Assche, Jan Kara

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>
---
 drivers/block/brd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 8b22e4a04918..6af087068ab3 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");
 
-static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
-module_param(rd_size, int, S_IRUGO);
+static 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;
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] brd: Make rd_size argument static
  2016-10-25 11:53 [PATCH 1/2] brd: Make rd_size argument static Jan Kara
  2016-10-25 11:53 ` [PATCH 2/2] brd: Switch rd_size to unsigned long Jan Kara
@ 2016-10-25 14:23 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2016-10-25 14:23 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-block, Bart Van Assche

On 10/25/2016 05:53 AM, Jan Kara wrote:
> rd_size does not appear to be used outside of brd. Make it static.

Applied both patches, thanks Jan.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-25 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 11:53 [PATCH 1/2] brd: Make rd_size argument static Jan Kara
2016-10-25 11:53 ` [PATCH 2/2] brd: Switch rd_size to unsigned long Jan Kara
2016-10-25 14:23 ` [PATCH 1/2] brd: Make rd_size argument static Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).