We show that $b \in BMO(\R^n)$ if and only if the commutator $[b,I_{\alpha}]$ of the multiplication operator by $b$ and the fractional integral operator $I_{\alpha}$ is bounded from generalized Morrey spaces $L^{p,\varphi}(\R^n)$ to $L^{q,\varphi^{q/p}}(\R^n)$, where $\varphi$ is non-decreasing, and $1