• Josh Durgin's avatar
    rbd: use reference counting for the snap context · d1d25646
    Josh Durgin authored
    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: default avatarJosh Durgin <josh.durgin@dreamhost.com>
    Reviewed-by: default avatarAlex Elder <elder@inktank.com>
    d1d25646
rbd.c 61.9 KB