提交 403f24d3 编写于 作者: J Josh Durgin 提交者: 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: NJosh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: NAlex Elder <elder@dreamhost.com>
Reviewed-by: NYehuda Sadeh <yehuda@hq.newdream.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册