mirror of
https://github.com/ceph/ceph
synced 2024-12-18 09:25:49 +00:00
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:
commit
7c5a36af06
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user