[dm-devel] rdac.c patch not quite right.

Malahal Naineni malahal at us.ibm.com
Wed Dec 8 21:39:36 UTC 2010


Chauhan, Vijay [Vijay.Chauhan at lsi.com] wrote:
> 
> In case of not connected device, only first condition is checked for PQ in rdac path checker. This patch
> corrects the check by masking MSB 3 bits and comparing it with 0x20. 
> 
> Signed-off-by: Vijay Chauhan <vijay.chauhan at lsi.com>
> ---
> --- multipath-tools-orig/libmultipath/checkers/rdac.c	2010-12-06 02:59:40.000000000 -0600
> +++ multipath-tools/libmultipath/checkers/rdac.c	2010-12-06 04:01:37.000000000 -0600
> @@ -107,7 +107,7 @@ libcheck_check (struct checker * c)
>  	if (0 != do_inq(c->fd, 0xC9, &inq, sizeof(struct volume_access_inq))) {
>  		ret = PATH_DOWN;
>  		goto done;
> -	} else if ((inq.PQ_PDT & 0x20) || (inq.PQ_PDT & 0x7f)) {
> +	} else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x7f)) {
>  		/* LUN not connected*/
>  		ret = PATH_DOWN;
>  		goto done;

I think this new patch has the same issue as the old one. In  other
words, the second expression in the parenthesis is true if the first one
is true. So you could as well just use the second expression. If you
really want to use PQ as well as PDT with separate checks, you can do
something like this:


	} else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x1F)) {
		/* LUN not connected or not a Direct Access device */
		ret = PATH_DOWN;
		goto done;

Please note the 7f to 1F change and the comment change to reflect the code
check.

Thanks, Malahal.




More information about the dm-devel mailing list