From: Josh Durgin Date: Mon, 5 Dec 2011 22:03:05 +0000 (-0800) Subject: rbd: use reference counting for the snap context X-Git-Tag: v3.6-rc1~36^2~42 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d25646543134d756a02ffe4e02073faa761f2c;p=pandora-kernel.git 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 Reviewed-by: Alex Elder --- Reading git-diff-tree failed