Skip to content
Snippets Groups Projects
Commit a428bbc8 authored by shattered's avatar shattered
Browse files

Treat CCISS drive number (N in -d cciss,N) as index into array of

available physical drives (starting at 0).  May help if certain drives
in an array are not accessible.


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2398 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 88ff05a0
Branches
No related tags found
No related merge requests found
CHANGELOG for smartmontools CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.610 2007/04/17 21:10:59 chrfranke Exp $ $Id: CHANGELOG,v 1.611 2007/04/20 20:41:00 shattered Exp $
The most recent version of this file is: The most recent version of this file is:
http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
...@@ -33,6 +33,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -33,6 +33,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[SS] CCISS physical drive enumeration method changed (incompatibly).
[CF] Fixed smartd crash on missing '-s' directive argument. [CF] Fixed smartd crash on missing '-s' directive argument.
[SS] Support CCISS on FreeBSD (kernel source is required). [SS] Support CCISS on FreeBSD (kernel source is required).
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
# include <linux/cciss_ioctl.h> # include <linux/cciss_ioctl.h>
# define _HAVE_CCISS # define _HAVE_CCISS
# endif # endif
# include <asm/byteorder.h>
# define be32toh __be32_to_cpu
#elif defined(__FreeBSD__) && defined(HAVE_DEV_CISS_CISSIO_H) #elif defined(__FreeBSD__) && defined(HAVE_DEV_CISS_CISSIO_H)
# include <sys/endian.h>
# include <dev/ciss/cissio.h> # include <dev/ciss/cissio.h>
# define _HAVE_CCISS # define _HAVE_CCISS
#endif #endif
...@@ -25,7 +28,7 @@ ...@@ -25,7 +28,7 @@
typedef struct _ReportLUNdata_struct typedef struct _ReportLUNdata_struct
{ {
uint8_t LUNListLength[4]; uint32_t LUNListLength; /* always big-endian */
uint32_t reserved; uint32_t reserved;
uint8_t LUN[CISS_MAX_LUN][8]; uint8_t LUN[CISS_MAX_LUN][8];
} ReportLunData_struct; } ReportLunData_struct;
...@@ -209,6 +212,7 @@ static int cciss_getlun(int device, int target, unsigned char *physlun, int repo ...@@ -209,6 +212,7 @@ static int cciss_getlun(int device, int target, unsigned char *physlun, int repo
pout("===== [%s] DATA END (%d Bytes) =====\n\n", "LUN DATA", sizeof(_ReportLUNdata_struct)); pout("===== [%s] DATA END (%d Bytes) =====\n\n", "LUN DATA", sizeof(_ReportLUNdata_struct));
} }
#if 0
for (i=0; i<CISS_MAX_LUN; i++) for (i=0; i<CISS_MAX_LUN; i++)
{ {
if (luns->LUN[i][6] == target) if (luns->LUN[i][6] == target)
...@@ -218,6 +222,14 @@ static int cciss_getlun(int device, int target, unsigned char *physlun, int repo ...@@ -218,6 +222,14 @@ static int cciss_getlun(int device, int target, unsigned char *physlun, int repo
return 0; return 0;
} }
} }
#else
if (target >= 0 && target < (int) be32toh(luns->LUNListLength) / 8)
{
memcpy(physlun, luns->LUN[target], 8);
free(luns);
return 0;
}
#endif
free(luns); free(luns);
return 1; return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment