You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.8 KiB

diff --git a/doc/sg_rdac.8 b/doc/sg_rdac.8
index 8e3d27a..cac0776 100644
--- a/doc/sg_rdac.8
+++ b/doc/sg_rdac.8
@@ -19,6 +19,8 @@ Transfer all (visible) devices
\fB\-f\fR=\fILUN\fR
Transfer the device identified by \fILUN\fR. This command will only work
if the controller supports 'Dual Active Mode' (aka active/active mode).
+\fILUN\fR is a decimal number which cannot exceed 31 when the \fI\-6\fR
+option is given, otherwise is cannot exceed 255.
.TP
\fB\-v\fR
be verbose
@@ -33,7 +35,7 @@ Written by Hannes Reinecke <hare at suse dot com>, based on sg_emc_trespass.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2006\-2012 Hannes Reinecke, Douglas Gilbert.
+Copyright \(co 2006\-2016 Hannes Reinecke, Douglas Gilbert.
.br
This software is distributed under the GPL version 2. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/src/sg_rdac.c b/src/sg_rdac.c
index ea243a2..63cfe46 100644
--- a/src/sg_rdac.c
+++ b/src/sg_rdac.c
@@ -188,9 +188,16 @@ static int fail_this_path(int fd, int lun, int use_6_byte)
struct rdac_page_common *rdac_common = NULL;
int res;
- if (use_6_byte && lun > 32) {
- fprintf(stderr, "must use 10 byte cdb to fail luns over 32\n");
- return -1;
+ if (use_6_byte) {
+ if (lun > 31) {
+ fprintf(stderr, "must use 10 byte cdb to fail luns over 31\n");
+ return -1;
+ }
+ } else { /* 10 byte cdb case */
+ if (lun > 255) {
+ fprintf(stderr, "lun cannot exceed 255\n");
+ return -1;
+ }
}
memset(fail_paths_pg, 0, 308);