ceph: Fix oops when handling mdsmap that decreases max_mds
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 20 Sep 2012 09:42:25 +0000 (17:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 08:56:50 +0000 (09:56 +0100)
commit1ad6768c537d57fec3dcb249cd384332cfacfe24
tree29a058ffaa2299ec3172cf5fb2a6dee60a089987
parentaeb469d6f6b311f531df80d25a82b297cffc4569
ceph: Fix oops when handling mdsmap that decreases max_mds

commit 3e8f43a089f06279c5f76a9ccd42578eebf7bfa5 upstream.

When i >= newmap->m_max_mds, ceph_mdsmap_get_addr(newmap, i) return
NULL. Passing NULL to memcmp() triggers oops.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/mds_client.c