mirror of
https://github.com/ceph/ceph
synced 2024-12-21 02:42:48 +00:00
librbd: take ImageCtx->snap_lock for write in add_snap()
add_snap() updates the ImageCtx snapshot metadata in memory, as well as reading the flags as part of the object map snapshot. Both of these require holding snap_lock. Signed-off-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
parent
40c2abb08a
commit
04d360a4c1
@ -1783,6 +1783,7 @@ reprotect_and_return_err:
|
||||
return r;
|
||||
}
|
||||
|
||||
RWLock::WLocker l(ictx->snap_lock);
|
||||
if (!ictx->old_format) {
|
||||
if (ictx->object_map != NULL) {
|
||||
ictx->object_map->snapshot(snap_id);
|
||||
|
Loading…
Reference in New Issue
Block a user