From cf454e30b64cfe4ec620adef09561f292de6acd3 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Tue, 11 May 2010 22:22:01 +0000 Subject: [PATCH] Deal sensibly with more than 26 sg devices. It isn't a complete solution. Sponsored by: Panasas MFC after: 1 week --- sys/cam/scsi/scsi_sg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_sg.c b/sys/cam/scsi/scsi_sg.c index 8ec01895dfad..de20731a3c30 100644 --- a/sys/cam/scsi/scsi_sg.c +++ b/sys/cam/scsi/scsi_sg.c @@ -303,7 +303,12 @@ sgregister(struct cam_periph *periph, void *arg) softc->dev = make_dev(&sg_cdevsw, periph->unit_number, UID_ROOT, GID_OPERATOR, 0600, "%s%d", periph->periph_name, periph->unit_number); - (void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number); + if (periph->unit_number < 26) { + (void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a'); + } else { + (void)make_dev_alias(softc->dev, "sg%c%c", + ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a'); + } cam_periph_lock(periph); softc->dev->si_drv1 = periph;