Skip to content

Commit

Permalink
ata_id: unreverse WWN identifier
Browse files Browse the repository at this point in the history
An endianness conversion was lost in 6024a6e.
Restore it. Now ata_id and scsi_id output match.

https://bugzilla.redhat.com/show_bug.cgi?id=1227503

Cherry-picked from: 01f61d3
Resolves: #1273306
  • Loading branch information
keszybz authored and lnykryn committed Feb 3, 2016
1 parent c731302 commit d1c32b6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/udev/ata_id/ata_id.c
Expand Up @@ -638,10 +638,20 @@ int main(int argc, char *argv[])
* All other values are reserved.
*/
word = identify.wyde[108];
if ((word & 0xf000) == 0x5000)
if ((word & 0xf000) == 0x5000) {
uint64_t wwwn;

wwwn = identify.wyde[108];
wwwn <<= 16;
wwwn |= identify.wyde[109];
wwwn <<= 16;
wwwn |= identify.wyde[110];
wwwn <<= 16;
wwwn |= identify.wyde[111];
printf("ID_WWN=0x%1$" PRIx64 "\n"
"ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n",
identify.octa[108/4]);
wwwn);
}

/* from Linux's include/linux/ata.h */
if (identify.wyde[0] == 0x848a ||
Expand Down

0 comments on commit d1c32b6

Please sign in to comment.