diff options
author | Dave Kleikamp <dave.kleikamp@oracle.com> | 2011-10-19 12:49:04 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-30 04:58:11 -0400 |
commit | 21208ae5a21fd5f337e987cde11374eaf2fe70b4 (patch) | |
tree | 3d835887fb1ce75e7dbf8b99f6086477db437c0e | |
parent | 6e88020025ccb6a6a0a54098acf1e187d2c9368c (diff) |
[SCSI] sd: remove arbitrary SD_MAX_DISKS namespace limit
There is no reason to limit the SCSI disk namespace to sdXXX.
Add new error messages to sd_probe() in the unlikely event that either
ida_get_new() or sd_format_disk_name() fail.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/sd.c | 12 | ||||
-rw-r--r-- | drivers/scsi/sd.h | 6 |
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a7942e5c8be8..fa3a5918009c 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -2590,18 +2590,16 @@ static int sd_probe(struct device *dev) | |||
2590 | spin_unlock(&sd_index_lock); | 2590 | spin_unlock(&sd_index_lock); |
2591 | } while (error == -EAGAIN); | 2591 | } while (error == -EAGAIN); |
2592 | 2592 | ||
2593 | if (error) | 2593 | if (error) { |
2594 | sdev_printk(KERN_WARNING, sdp, "sd_probe: memory exhausted.\n"); | ||
2594 | goto out_put; | 2595 | goto out_put; |
2595 | |||
2596 | if (index >= SD_MAX_DISKS) { | ||
2597 | error = -ENODEV; | ||
2598 | sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n"); | ||
2599 | goto out_free_index; | ||
2600 | } | 2596 | } |
2601 | 2597 | ||
2602 | error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN); | 2598 | error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN); |
2603 | if (error) | 2599 | if (error) { |
2600 | sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length exceeded.\n"); | ||
2604 | goto out_free_index; | 2601 | goto out_free_index; |
2602 | } | ||
2605 | 2603 | ||
2606 | sdkp->device = sdp; | 2604 | sdkp->device = sdp; |
2607 | sdkp->driver = &sd_template; | 2605 | sdkp->driver = &sd_template; |
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index 6ad798bfd52a..4163f2910e3d 100644 --- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h | |||
@@ -9,12 +9,6 @@ | |||
9 | #define SD_MAJORS 16 | 9 | #define SD_MAJORS 16 |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * This is limited by the naming scheme enforced in sd_probe, | ||
13 | * add another character to it if you really need more disks. | ||
14 | */ | ||
15 | #define SD_MAX_DISKS (((26 * 26) + 26 + 1) * 26) | ||
16 | |||
17 | /* | ||
18 | * Time out in seconds for disks and Magneto-opticals (which are slower). | 12 | * Time out in seconds for disks and Magneto-opticals (which are slower). |
19 | */ | 13 | */ |
20 | #define SD_TIMEOUT (30 * HZ) | 14 | #define SD_TIMEOUT (30 * HZ) |