  We present 850 $\mu$m dust polarization observations of the massive DR21
filament from the B-fields In STar-forming Region Observations (BISTRO) survey,
using the POL-2 polarimeter and the SCUBA-2 camera on the James Clerk Maxwell
Telescope. We detect ordered magnetic fields perpendicular to the parsec-scale
ridge of the DR21 main filament. In the sub-filaments, the magnetic fields are
mainly parallel to the filamentary structures and smoothly connect to the
magnetic fields of the main filament. We compare the POL-2 and Planck dust
polarization observations to study the magnetic field structures of the DR21
filament on 0.1--10 pc scales. The magnetic fields revealed in the Planck data
are well aligned with those of the POL-2 data, indicating a smooth variation of
magnetic fields from large to small scales. The plane-of-sky magnetic field
strengths derived from angular dispersion functions of dust polarization are
0.6--1.0 mG in the DR21 filament and $\sim$ 0.1 mG in the surrounding ambient
gas. The mass-to-flux ratios are found to be magnetically supercritical in the
filament and slightly subcritical to nearly critical in the ambient gas. The
alignment between column density structures and magnetic fields changes from
random alignment in the low-density ambient gas probed by Planck to mostly
perpendicular in the high-density main filament probed by JCMT. The magnetic
field structures of the DR21 filament are in agreement with MHD simulations of
a strongly magnetized medium, suggesting that magnetic fields play an important
role in shaping the DR21 main filament and sub-filaments.
