In a recent study [Phys. Rev. E 94, 022103 (2016)] it has been shown that, for a fluid film subject to critical adsorption, the resulting critical Casimir force (CCF) may significantly depend on the thermodynamic ensemble. Here, we extend that study by considering fluid films within the so-called ordinary surface universality class. We focus on mean-field theory, within which the order parameter (OP) profile satisfies Dirichlet boundary conditions and produces a nontrivial CCF in the presence of external bulk fields or, respectively, a nonzero total order parameter within the film. Additionally, we study the influence of fluctuations by means of Monte Carlo simulations of the three-dimensional Ising model. We show that, in the canonical ensemble, i.e., when fixing the so-called total mass within the film, the CCF is repulsive for large absolute values of the total OP, instead of attractive as in the grand canonical ensemble. Based on the Landau-Ginzburg free energy, we furthermore obtain analytic expressions for the order parameter profiles and analyze the relation between the total mass in the film and the external bulk field.is defined in terms of the bulk OP φ b , which, near criticality, behaves asfor µ = 0 and t → 0, (6a) φ b,µ = sgn(µ)φ (0) µ |µ| 1/δ , for t = 0 and µ → 0, (6b) in the case of a vanishing external field µ and a vanishing reduced temperature t, respectively.