Re: properly name raid volumes on mpii

2011-02-24 Thread David Gwynne
On 24/02/2011, at 5:33 PM, Mark Kettenis wrote:

 Hmm, this looks like a fix for PR 6269, although that report is for
 mpi(4).  Any chance a similar fix works for mpi(4)?

thats a fairly old PR. is anyone able to reproduce it on mpi(4) with a modern
kernel?

dlg



Re: properly name raid volumes on mpii

2011-02-24 Thread David Gwynne
On 24/02/2011, at 6:51 PM, David Gwynne wrote:

 On 24/02/2011, at 5:33 PM, Mark Kettenis wrote:

 Hmm, this looks like a fix for PR 6269, although that report is for
 mpi(4).  Any chance a similar fix works for mpi(4)?

 thats a fairly old PR. is anyone able to reproduce it on mpi(4) with a
modern
 kernel?

hrm, a quick look over the code isnt inspiring :/



Re: properly name raid volumes on mpii

2011-02-24 Thread Mike Belopuhov
On Thu, Feb 24, 2011 at 11:42 +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?
 

ok.  didn't know that this problem exists :)

 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.c21 Feb 2011 09:36:15 -  1.38
 +++ mpii.c24 Feb 2011 01:40:08 -
 @@ -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));



Re: properly name raid volumes on mpii

2011-02-23 Thread Mark Kettenis
 Date: Thu, 24 Feb 2011 11:42:51 +1000
 From: David Gwynne l...@animata.net
 
 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?

Hmm, this looks like a fix for PR 6269, although that report is for
mpi(4).  Any chance a similar fix works for mpi(4)?

 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.c21 Feb 2011 09:36:15 -  1.38
 +++ mpii.c24 Feb 2011 01:40:08 -
 @@ -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));