  We answer affirmatively a question of Srinivas--Trivedi: in a Noetherian
local ring $(R,\mathfrak{m})$, if $I=(f_1,\dots,f_r)$ is an ideal generated by
a filter-regular sequence and $J$ is an ideal such that $I+J$ is
$\mathfrak{m}$-primary, then there exists $N>0$ such that for any
$\varepsilon_1,\dots,\varepsilon_r \in \mathfrak{m}^N$, we have an equality of
Hilbert functions: $H(J, R/(f_1,\dots,f_r))(n)=H(J, R/(f_1+\varepsilon_1,\dots,
f_r+\varepsilon_r))(n)$ for all $n\geq 0$. We also prove that the dimension of
the non Cohen--Macaulay locus does not increase under small perturbations.
