diff options
author | Sage Weil <sage@newdream.net> | 2011-04-19 22:49:06 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-05-24 11:52:08 -0700 |
commit | 9db4b3e32778400555d5cc6fb61d4058902d37f7 (patch) | |
tree | 06080e941734876ae0c1c4d353a50a160a940907 /drivers/block | |
parent | 45e3d3eeb6578e523e100622266945ecd71723bb (diff) | |
download | linux-9db4b3e32778400555d5cc6fb61d4058902d37f7.tar.gz linux-9db4b3e32778400555d5cc6fb61d4058902d37f7.tar.bz2 linux-9db4b3e32778400555d5cc6fb61d4058902d37f7.zip |
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')
-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) if (ret < 0) return ret; + /* resized? */ + set_capacity(rbd_dev->disk, h.image_size / 512ULL); + down_write(&rbd_dev->header.snap_rwsem); snap_seq = rbd_dev->header.snapc->seq; |