linux/net/ceph
Alex Elder 14d2f38df6 libceph: must hold mutex for reset_changed_osds()
An osd client has a red-black tree describing its osds, and
occasionally we would get crashes due to one of these trees tree
becoming corrupt somehow.

The problem turned out to be that reset_changed_osds() was being
called without protection of the osd client request mutex.  That
function would call __reset_osd() for any osd that had changed, and
__reset_osd() would call __remove_osd() for any osd with no
outstanding requests, and finally __remove_osd() would remove the
corresponding entry from the red-black tree.  Thus, the tree was
getting modified without having any lock protection, and was
vulnerable to problems due to concurrent updates.

This appears to be the only osd tree updating path that has this
problem.  It can be fairly easily fixed by moving the call up
a few lines, to just before the request mutex gets dropped
in kick_requests().

This resolves:
    http://tracker.ceph.com/issues/5043

Cc: stable@vger.kernel.org # 3.4+
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-17 12:45:40 -05:00
..
crush
armor.c
auth_none.c
auth_none.h
auth_x_protocol.h
auth_x.c libceph: wrap auth ops in wrapper functions 2013-05-01 21:17:14 -07:00
auth_x.h libceph: add update_authorizer auth method 2013-05-01 21:17:13 -07:00
auth.c libceph: wrap auth methods in a mutex 2013-05-01 21:17:15 -07:00
buffer.c
ceph_common.c libceph: use slab cache for osd client requests 2013-05-02 11:58:41 -05:00
ceph_fs.c
ceph_hash.c
ceph_strings.c
crypto.c
crypto.h
debugfs.c libceph: keep source rather than message osd op array 2013-05-01 21:18:12 -07:00
Kconfig
Makefile libceph: create source file "net/ceph/snapshot.c" 2013-05-01 21:20:08 -07:00
messenger.c libceph: allocate ceph message data with a slab allocator 2013-05-02 11:58:36 -05:00
mon_client.c libceph: wrap auth ops in wrapper functions 2013-05-01 21:17:14 -07:00
msgpool.c
osd_client.c libceph: must hold mutex for reset_changed_osds() 2013-05-17 12:45:40 -05:00
osdmap.c libceph: define ceph_decode_pgid() only once 2013-05-01 21:17:52 -07:00
pagelist.c
pagevec.c
snapshot.c libceph: create source file "net/ceph/snapshot.c" 2013-05-01 21:20:08 -07:00