We discuss the implications of the (preliminary) CMS dijet data from 5.02 TeV pp and pPb collisions for gluon PDFs of the proton and nuclei. The preliminary pp data show a discrepancy with NLO predictions using CT14 and MMHT14 PDFs. We find that this difference cannot be accommodated with the associated scale uncertainties and debate the possible changes needed in the gluon PDFs. A similar discrepancy is found between the CMS pPb data and NLO predictions e.g. with EPPS16 nuclear modifications imposed on CT14 proton PDFs. When a nuclear modification ratio of the pp and pPb data is constructed, the uncertainties in the scale choices and in proton PDFs effectively cancel and a good agreement between the data and EPPS16 is found, except in some bins at backward rapidities corresponding to large x of the nucleus. To assess the impact of these data on EPPS16 nuclear PDFs, we use a non-quadratic extension of the Hessian reweighting method. A significant reduction in EPPS16 uncertainties is obtained with the fit supporting strong nuclear shadowing and valence-like antishadowing for gluons. We also indicate the possible changes needed in the EPPS16 parametrization at large x.