]> git.baikalelectronics.ru Git - kernel.git/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)
committerSage Weil <sage@inktank.com>
Tue, 31 Jul 2012 01:15:40 +0000 (18:15 -0700)
commitd4599d404e28f4788f49babe2b76614217729c3d
treec68bf9aae4a362dd17f441f005bbdc7ca23fafb9
parent7ecfeec0890e29d06ef9a2bd3dd23dfe59f2fa4a
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>
drivers/block/rbd.c