From a Math Measurements dictionary,
M [1]
informal abbreviation for million in expressions where the base unit is understood, as in "500M hard drive" (500 megabytes or mebibytes). In chemistry, M is the symbol for "molar" (see below).
M [2]
the Roman numeral 1000, sometimes used in symbols to indicate a thousand, as in Mcf, a traditional symbol for 1000 cubic feet. Given the widespread use of M to mean one million, this older use of M to mean 1000 is very confusing and should be scrapped.
http://www.unc.edu/~rowlett/units/index.html