Commit 403f24d3 authored by Josh Durgin's avatar Josh Durgin Committed by Alex Elder

rbd: protect read of snapshot sequence number

This is updated whenever a snapshot is added or deleted, and the
snapc pointer is changed with every refresh of the header.
Signed-off-by: default avatarJosh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: default avatarAlex Elder <elder@dreamhost.com>
Reviewed-by: default avatarYehuda Sadeh <yehuda@hq.newdream.net>
parent 50f7c4c9
......@@ -1684,7 +1684,9 @@ static int rbd_header_add_snap(struct rbd_device *dev,
if (ret < 0)
return ret;
dev->header.snapc->seq = new_snapid;
down_write(&dev->header_rwsem);
dev->header.snapc->seq = new_snapid;
up_write(&dev->header_rwsem);
return 0;
bad:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment