]> git.hungrycats.org Git - linux/commit
rbd: use reference counting for the snap context
authorJosh Durgin <josh.durgin@dreamhost.com>
Mon, 5 Dec 2011 22:03:05 +0000 (14:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:51:18 +0000 (08:51 -0800)
commitfc5eb627a897ac41581692abf60ffea874df2e55
tree5b0a4a9571d5b59bb491f049826aef06abef1931
parent894910deddfe36e66079bea42ae9d728b3f4b5cc
rbd: use reference counting for the snap context

This prevents a race between requests with a given snap context and
header updates that free it. The osd client was already expecting the
snap context to be reference counted, since it get()s it in
ceph_osdc_build_request and put()s it when the request completes.

Also remove the second down_read()/up_read() on header_rwsem in
rbd_do_request, which wasn't actually preventing this race or
protecting any other data.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: Alex Elder <elder@inktank.com>
(cherry picked from commit d1d25646543134d756a02ffe4e02073faa761f2c)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/rbd.c