[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>
This commit is contained in:
		
					parent
					
						
							
								6e88020025
							
						
					
				
			
			
				commit
				
					
						21208ae5a2
					
				
			
		
					 2 changed files with 5 additions and 13 deletions
				
			
		|  | @ -2590,18 +2590,16 @@ static int sd_probe(struct device *dev) | ||||||
| 		spin_unlock(&sd_index_lock); | 		spin_unlock(&sd_index_lock); | ||||||
| 	} while (error == -EAGAIN); | 	} while (error == -EAGAIN); | ||||||
| 
 | 
 | ||||||
| 	if (error) | 	if (error) { | ||||||
|  | 		sdev_printk(KERN_WARNING, sdp, "sd_probe: memory exhausted.\n"); | ||||||
| 		goto out_put; | 		goto out_put; | ||||||
| 
 |  | ||||||
| 	if (index >= SD_MAX_DISKS) { |  | ||||||
| 		error = -ENODEV; |  | ||||||
| 		sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n"); |  | ||||||
| 		goto out_free_index; |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN); | 	error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN); | ||||||
| 	if (error) | 	if (error) { | ||||||
|  | 		sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length exceeded.\n"); | ||||||
| 		goto out_free_index; | 		goto out_free_index; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	sdkp->device = sdp; | 	sdkp->device = sdp; | ||||||
| 	sdkp->driver = &sd_template; | 	sdkp->driver = &sd_template; | ||||||
|  |  | ||||||
|  | @ -8,12 +8,6 @@ | ||||||
|  */ |  */ | ||||||
| #define SD_MAJORS	16 | #define SD_MAJORS	16 | ||||||
| 
 | 
 | ||||||
| /*
 |  | ||||||
|  * This is limited by the naming scheme enforced in sd_probe, |  | ||||||
|  * add another character to it if you really need more disks. |  | ||||||
|  */ |  | ||||||
| #define SD_MAX_DISKS	(((26 * 26) + 26 + 1) * 26) |  | ||||||
| 
 |  | ||||||
| /*
 | /*
 | ||||||
|  * Time out in seconds for disks and Magneto-opticals (which are slower). |  * Time out in seconds for disks and Magneto-opticals (which are slower). | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dave Kleikamp
				Dave Kleikamp