Merge pull request #163 from ceph/wip-rbd-snapset-cache

librbd: flush cache when set_snap() is called

Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-03-28 07:33:50 -07:00
commit 7c5a36af06

View File

@ -1898,6 +1898,12 @@ reprotect_and_return_err:
// ignore return value, since we may be set to a non-existent
// snapshot and the user is trying to fix that
ictx_check(ictx);
if (ictx->object_cacher) {
// complete pending writes before we're set to a snapshot and
// get -EROFS for writes
RWLock::WLocker l(ictx->md_lock);
ictx->flush_cache();
}
return _snap_set(ictx, snap_name);
}