On Thu, Feb 24, 2011 at 11:42:51AM +1000, David Gwynne wrote:
> you want to look up disks attached to an mpi by bus addressing, not
> which raid volume you happen to be up to.
> 
> before this diff i got:
> 
> dlg@hotspare dlg$ sudo bioctl mpii0
> Volume  Status               Size Device  
> mpii0 0 Online       146163105280         RAID1
>       0 Online       146815733248 0:2.0   noencl <SEAGATE ST9146852SS>
>       1 Online       146815733248 0:3.0   noencl <SEAGATE ST9146852SS>
> mpii0 1 Rebuild      148444806656 sd0     RAID1 78% done
>       0 Online       149039750656 0:0.0   noencl <Pliant LB150S>
>       1 Rebuild      149039750656 0:1.0   noencl <Pliant LB150S>
> 
> after:
> 
> dlg@hotspare pci$ sudo bioctl mpii0
> Volume  Status               Size Device  
> mpii0 0 Online       146163105280 sd0     RAID1
>       0 Online       146815733248 0:2.0   noencl <SEAGATE ST9146852SS>
>       1 Online       146815733248 0:3.0   noencl <SEAGATE ST9146852SS>
> mpii0 1 Rebuild      148444806656 sd1     RAID1 84% done
>       0 Online       149039750656 0:0.0   noencl <Pliant LB150S>
>       1 Rebuild      149039750656 0:1.0   noencl <Pliant LB150S>
> 
> this also lets me address volumes by name (eg, bioctl sd1) now.
> 
> ok?
> 
> Index: mpii.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/mpii.c,v
> retrieving revision 1.38
> diff -u -p -r1.38 mpii.c
> --- mpii.c    21 Feb 2011 09:36:15 -0000      1.38
> +++ mpii.c    24 Feb 2011 01:40:08 -0000
> @@ -4958,7 +4988,7 @@ mpii_ioctl_vol(struct mpii_softc *sc, st
>  
>       bv->bv_size = letoh64(vpg->max_lba) * letoh16(vpg->block_size);
>  
> -     lnk = scsi_get_link(sc->sc_scsibus, bv->bv_volid, 0);
> +     lnk = scsi_get_link(sc->sc_scsibus, dev->slot, 0);
>       if (lnk != NULL) {
>               scdev = lnk->device_softc;
>               strlcpy(bv->bv_dev, scdev->dv_xname, sizeof(bv->bv_dev));

Output certainly looks more useful and the code more correct. ok krw@.

.... Ken

Reply via email to