From: Josh Durgin Date: Tue, 26 Feb 2013 21:20:08 +0000 (-0800) Subject: librbd: fix rollback size X-Git-Tag: v0.58~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f58601d681d3aee6541119ab830ba5e2a9ec3a13;p=ceph.git librbd: fix rollback size The duplicate calls to get_image_size() and get_snap_size() replaced by 5806226cf0743bb44eaf7bc815897c6846d43233 uncovered this. The first call was using the currently set snap_id instead of the snapshot being rolled back to. Fixes: #4272 Signed-off-by: Josh Durgin Reviewed-by: Sage Weil --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a4c25dfaa52..c5f2c137ee4 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1765,7 +1765,7 @@ reprotect_and_return_err: lderr(cct) << "No such snapshot found." << dendl; return -ENOENT; } - new_size = ictx->get_image_size(ictx->snap_id); + new_size = ictx->get_image_size(snap_id); } // need to flush any pending writes before resizing and rolling back -