retry tur on reset
PATCH 1/1 retry tur on reset
hi christophe,
this patch retries the tur sgio in the tur checker when the status returned is a scsi reset.
cheers,
brian
libcheckers/tur.c +22 -4
@@ -43,7 +43,7 @@ tur (struct checker * c)struct sg_io_hdr io_hdr;unsigned char turCmdBlk[TUR_CMD_LEN ] = {0x00 ,0 ,0 ,0 ,0 ,0 };unsigned char sense_buffer[32 ]; - +memset (&io_hdr,0 ,sizeof (struct sg_io_hdr )); io_hdr.interface_id ='S' ; io_hdr.cmd_len =sizeof (turCmdBlk);
@@ -53,10 +53,28 @@ tur (struct checker * c) io_hdr.sbp = sense_buffer; io_hdr.timeout =20000 ; io_hdr.pack_id =0 ; -if (ioctl (c->fd,SG_IO , &io_hdr) <0 ) { + do_sgio: +if (ioctl (c->fd,SG_IO , &io_hdr) <0 ) {MSG (c,MSG_TUR_DOWN ); -return PATH_DOWN ; - } +return PATH_DOWN ; + } +if (io_hdr.status ==SCSI_CHECK_CONDITION ) { +if (io_hdr.sbp && (io_hdr.sb_len_wr >2 )) { +int sense_key; +unsigned char * sense_buffer = io_hdr.sbp; + +if (sense_buffer[0 ] &0x2 ) + sense_key = sense_buffer[1 ] &0xf ; +else + sense_key = sense_buffer[2 ] &0xf ; + +/* retry UA, SCSI RESET conditions */ +if (sense_key ==0x06 && sense_buffer[12 ] ==0x29 ) { + goto do_sgio; + } + + } + }if (io_hdr.info &SG_INFO_OK_MASK ) {MSG (c,MSG_TUR_DOWN );return PATH_DOWN ;
Quoted 5 lines · Brian Wong
hi christophe,
this patch retries the tur sgio in the tur checker when the status returned is a scsi reset.
Interesting.
Can you share a little background about why this is needed, test case ?
Regards,
cvaroqui
[multipath-tools] maximum LUNs
In reply to Brian Wong