After receiving a real-live bug report on my seemingly simple megamap
I have made a major enhancement. Thanks to Harry Lee I learned that the off-by-one nature of things was a mere subset of the ways that Linux and LSI might munge the WWN's. It might subtract two or three or more. While I can imagine any number of possible reasons for this weirdness I have yet not dug into the kernel sources to confirm or deny any of these ideas.
To deal with this I have altered megamap
to accept a wider range of WWN's from the Linux side. This increases the chance of false positive matches and there remains a chance of false negative still. If you find examples of this in practice I'd love to hear about it.
P.S. have you upvoted my answer to this issue on serverfault ?