A magnetic sensor includes a spacer having at least a nonmagnetic metal
layer inserted between the upper shield layer and the longitudinal bias
layers or between the upper shield layer and the longitudinal bias layers
plus the magnetoresistive film, the shortest distance between the
longitudinal bias layers and the free layer of the magnetoresistive film
is set smaller than the shortest distance between the longitudinal bias
layers and the upper shield layer, and this arrangement ensures that the
amount of magnetic flux entering the magnetoresistive film from the
longitudinal bias layers is larger than that absorbed by the upper shield
layer, thus realizing a magnetic sensor whose Barkhausen noise is
suppressed.