diff options
author | Sage Weil <sage@newdream.net> | 2011-04-20 01:49:06 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-05-24 14:52:08 -0400 |
commit | 9db4b3e32778400555d5cc6fb61d4058902d37f7 (patch) | |
tree | 06080e941734876ae0c1c4d353a50a160a940907 /drivers/block/rbd.c | |
parent | 45e3d3eeb6578e523e100622266945ecd71723bb (diff) |
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: Sage Weil <sage@newdream.net>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d833d02b321f..1278098624e6 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -1664,6 +1664,9 @@ static int __rbd_update_snaps(struct rbd_device *rbd_dev) | |||
1664 | if (ret < 0) | 1664 | if (ret < 0) |
1665 | return ret; | 1665 | return ret; |
1666 | 1666 | ||
1667 | /* resized? */ | ||
1668 | set_capacity(rbd_dev->disk, h.image_size / 512ULL); | ||
1669 | |||
1667 | down_write(&rbd_dev->header.snap_rwsem); | 1670 | down_write(&rbd_dev->header.snap_rwsem); |
1668 | 1671 | ||
1669 | snap_seq = rbd_dev->header.snapc->seq; | 1672 | snap_seq = rbd_dev->header.snapc->seq; |