directio path-checker for multipath-tools
Hi Christophe,
I've implemented yet another path checker, based on O_DIRECT.
Rationale: On S/390 it's possible to activate multipath support for DASD devices (called Parallel Access Volume (PAV)). As these are no SCSI devices the readsector0 path checker wouldn't work.
And as this checker is quite generic it'll work for just about anybody.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke [email protected] SuSE Linux Products GmbH S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de
libcheckers/checkers.h +1 -0
@@ -9,6 +9,7 @@ enum checkers {CHECKER_RESERVED ,TUR ,READSECTOR0 , +DIRECTIO , EMC_CLARIION,
HP_SW
};
@@ -20,6 +21,7 @@ void *get_checker_addr (int);
int get_checker_name (char *, int);
int emc_clariion (int fd, char * msg, void ** ctxt);
+int directio (int fd, char * msg, void ** ctxt);
int readsector0 (int fd, char * msg, void ** ctxt); int tur (int fd, char * msg, void ** ctxt);
libcheckers/directio.c +165 -0
165 lines not on this page · raw message
libcheckers/Makefile +1 -1
@@ -6,7 +6,7 @@ BUILD = glibc include ../Makefile.inc -OBJS = readsector0.o tur.o selector.o emc_clariion.o hp_sw.o +OBJS = readsector0.o tur.o selector.o directio.o emc_clariion.o hp_sw.o all: $(BUILD)
libcheckers/selector.c +8 -0
@@ -10,6 +10,8 @@ get_checker_id (char * str)return TUR ;if (0 ==strncmp (str,"readsector0" ,11 ))return READSECTOR0 ; +if (0 ==strncmp (str,"directio" ,8 )) +return DIRECTIO ;if (0 ==strncmp (str,"emc_clariion" ,12 ))return EMC_CLARIION ;return -1 ;
@@ -27,6 +29,9 @@ get_checker_addr (int id)case READSECTOR0 : checker = &readsector0;break ; +case DIRECTIO : + checker = &directio; +break ;case EMC_CLARIION : checker = &emc_clariion;break ;
@@ -49,6 +54,9 @@ get_checker_name (char * str, int id)case READSECTOR0 : s ="readsector0" ;break ; +case DIRECTIO : + s ="directio" ; +break ;case EMC_CLARIION : s ="emc_clariion" ;break ;
Sorry I didn't reply earlier.
Nice work.
+ buf = (unsigned char *)malloc(blksize + pgsize);
+ if (!buf){
+ goto out;
+ }
Don't you want to use an oversized buffer instead of malloc'ing in this code path ?
Quoted 15 lines · Hannes Reinecke
Hi Christophe,
I've implemented yet another path checker, based on
O_DIRECT.
Rationale: On S/390 it's possible to activate multipath support for DASD devices (called Parallel Access Volume (PAV)). As these are no SCSI devices the readsector0 path checker wouldn't work.
And as this checker is quite generic it'll work for just about anybody.Cheers,
Hannes
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Signature · 1 line
christophe varoqui <[email protected]>
And may I safely cast to (unsigned char *) instead of (char *) at directio.c::137 ? There is a compilation warning there as is.
Regards,
Quoted 8 lines · Hannes Reinecke
Hi Christophe,
I've implemented yet another path checker, based on
O_DIRECT.
Rationale: On S/390 it's possible to activate multipath support for DASD devices (called Parallel Access Volume (PAV)). As these are no SCSI devices the readsector0 path checker wouldn't work.
And as this checker is quite generic it'll work for just about anybody.
Signature · 1 line
christophe varoqui <[email protected]>
Quoted 8 lines · Hannes Reinecke
Hi Christophe,
I've implemented yet another path checker, based on
O_DIRECT.
Rationale: On S/390 it's possible to activate multipath support for DASD devices (called Parallel Access Volume (PAV)). As these are no SCSI devices the readsector0 path checker wouldn't work.
And as this checker is quite generic it'll work for just about anybody.
There seem to be cases where this checker can "hang forever" on failing paths, and thus block the whole daemon. If I understand correctly the open() manual, O_DIRECT reads by-design block until the data is sent back.
If there is a trick to unblock the checker I'd like to learn it, because as-is this checker is really more dangerous than useful :/
I hit this problem easily by bringing down the network interface supporting the iSCSI trafic to an sfnet-IET target.
Regards,
cvaroqui
PS: I have to check if other checkers are not affected too. If I remember we needed some SG infrastructure to let our checkers ask the kernel to FAILFAST its requests ...