Skip to content

Commit 21208ae

Browse files
kleikampJames Bottomley
authored andcommitted
[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>
1 parent 6e88020 commit 21208ae

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

drivers/scsi/sd.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,18 +2590,16 @@ static int sd_probe(struct device *dev)
25902590
spin_unlock(&sd_index_lock);
25912591
} while (error == -EAGAIN);
25922592

2593-
if (error)
2593+
if (error) {
2594+
sdev_printk(KERN_WARNING, sdp, "sd_probe: memory exhausted.\n");
25942595
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;
26002596
}
26012597

26022598
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");
26042601
goto out_free_index;
2602+
}
26052603

26062604
sdkp->device = sdp;
26072605
sdkp->driver = &sd_template;

drivers/scsi/sd.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
*/
99
#define SD_MAJORS 16
1010

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-
1711
/*
1812
* Time out in seconds for disks and Magneto-opticals (which are slower).
1913
*/

0 commit comments

Comments
 (0)