aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-04-19 22:49:06 -0700
committerSage Weil <sage@newdream.net>2011-05-24 11:52:08 -0700
commit9db4b3e32778400555d5cc6fb61d4058902d37f7 (patch)
tree06080e941734876ae0c1c4d353a50a160a940907
parent45e3d3eeb6578e523e100622266945ecd71723bb (diff)
downloadkernel_samsung_aries-9db4b3e32778400555d5cc6fb61d4058902d37f7.zip
kernel_samsung_aries-9db4b3e32778400555d5cc6fb61d4058902d37f7.tar.gz
kernel_samsung_aries-9db4b3e32778400555d5cc6fb61d4058902d37f7.tar.bz2
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>
-rw-r--r--drivers/block/rbd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d833d02..1278098 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;