summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-16 15:45:41 -0700
committerSage Weil <sage@inktank.com>2013-04-16 15:46:32 -0700
commit899456617f83823af93a365253770c01b5d8b716 (patch)
tree31ba079685965ed568f3e9677ac18bb1619227a2
parent103fb9b0fbbed300a679d5546a5c920d288e1d5c (diff)
downloadceph-899456617f83823af93a365253770c01b5d8b716.tar.gz
librbd: flush on diff_iterate
The diff_iterate() tests fail when caching is enabled because recent writes aren't visible to listsnaps. Flush from diff_iterate to ensure that they are. Someday, maybe, we might make diff_iterate() inspect the cache contents to make this more efficient, but for now that is not necessary. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/librbd/internal.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc
index 55461aa3a70..c56f0a553b0 100644
--- a/src/librbd/internal.cc
+++ b/src/librbd/internal.cc
@@ -2291,6 +2291,9 @@ reprotect_and_return_err:
ldout(ictx->cct, 20) << "diff_iterate " << ictx << " off = " << off
<< " len = " << len << dendl;
+ // ensure previous writes are visible to listsnaps
+ _flush(ictx);
+
int r = ictx_check(ictx);
if (r < 0)
return r;