Skip to content

Commit

Permalink
rbd: handle online resize of underlying rbd image
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed May 24, 2011
1 parent 45e3d3e commit 9db4b3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9db4b3e

Please sign in to comment.