Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253019
b: refs/heads/master
c: 3b27108
h: refs/heads/master
i:
  253017: e9cd99e
  253015: d4479a0
v: v3
  • Loading branch information
Namhyung Kim authored and Jens Axboe committed May 28, 2011
1 parent d592e31 commit 7684720
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35fbf5bcf497d6ddbe7b6478141e7526d1474ff5
refs/heads/master: 3b2710824e00d238554c13b5add347e6c701ab1a
6 changes: 6 additions & 0 deletions trunk/drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,12 @@ static int __init nbd_init(void)
if (max_part > 0)
part_shift = fls(max_part);

if ((1UL << part_shift) > DISK_MAX_PARTS)
return -EINVAL;

if (nbds_max > 1UL << (MINORBITS - part_shift))
return -EINVAL;

for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1 << part_shift);
if (!disk)
Expand Down

0 comments on commit 7684720

Please sign in to comment.