  We investigate the mass distribution of long gamma-ray burst (GRB) host
galaxies and the redshift distribution of long GRBs by considering that long
GRBs occur in low-metallicity environments. We calculate the upper limit on the
stellar mass of a galaxy which can produce long GRBs by utilizing the
mass-metallicity (M-Z) relation of galaxies. After comparing with the observed
GRB host galaxies masses, we find that the observed GRB host galaxy masses can
fit the predicted masses well if GRBs occur in low-metallicity
$12+\log\rm(O/H)_{\rm KK04}<8.7$. GRB host galaxies have low metallicity, low
mass, and high star formation rate compared with galaxies of seventh data
release of the Sloan Digital Sky Survey. We also study the cumulative redshift
distribution of the latest \emph{Swift} long GRBs by adding dark GRBs and 10
new GRBs redshifts from TOUGH survey. The observed discrepancy between the GRB
rate and the star formation history can be reconciled by considering that GRBs
tend to occur in low-metallicity galaxies with $12+\log\rm(O/H)_{\rm
KK04}<8.7$. We conclude that the metallicity cutoff that can produce long GRBs
is about $12+\log\rm(O/H)_{\rm KK04}<8.7$ from the host mass distribution and
redshift distribution.
