Hydrogels prepared from cellulose nanofibrils via ferric ion-mediated crosslinking reaction for protecting drilling fluid.