提交 9db4b3e3 编写于 作者: S Sage Weil

rbd: handle online resize of underlying rbd image

If we get a notification that the image header has changed, check for
a change in the image size.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 45e3d3ee
...@@ -1664,6 +1664,9 @@ static int __rbd_update_snaps(struct rbd_device *rbd_dev) ...@@ -1664,6 +1664,9 @@ static int __rbd_update_snaps(struct rbd_device *rbd_dev)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* resized? */
set_capacity(rbd_dev->disk, h.image_size / 512ULL);
down_write(&rbd_dev->header.snap_rwsem); down_write(&rbd_dev->header.snap_rwsem);
snap_seq = rbd_dev->header.snapc->seq; snap_seq = rbd_dev->header.snapc->seq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册