Skip to content

Commit

Permalink
librbd: take ImageCtx->snap_lock for write in add_snap()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jdurgin committed Feb 25, 2015
1 parent 40c2abb commit 04d360a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librbd/internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ namespace librbd {
return r;
}

RWLock::WLocker l(ictx->snap_lock);
if (!ictx->old_format) {
if (ictx->object_map != NULL) {
ictx->object_map->snapshot(snap_id);
Expand Down

0 comments on commit 04d360a

Please sign in to comment.