diff options
author | Sage Weil <sage@newdream.net> | 2010-03-19 21:24:39 +0100 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-03-23 15:47:02 +0100 |
commit | ec4318bcb4c59d8b8bf7037c9f444a9887ccb265 (patch) | |
tree | 9c471ed9e33b864253166c255c1fd601b909c7af /fs/ceph/snap.c | |
parent | ceph: avoid reopening osd connections when address hasn't changed (diff) | |
download | linux-ec4318bcb4c59d8b8bf7037c9f444a9887ccb265.tar.xz linux-ec4318bcb4c59d8b8bf7037c9f444a9887ccb265.zip |
ceph: fix snap rebuild condition
We were rebuilding the snap context when it was not necessary
(i.e. when the realm seq hadn't changed _and_ the parent seq
was still older), which caused page snapc pointers to not match
the realm's snapc pointer (even though the snap context itself
was identical). This confused begin_write and put it into an
endless loop.
The correct logic is: rebuild snapc if _my_ realm seq changed, or
if my parent realm's seq is newer than mine (and thus mine needs
to be rebuilt too).
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r-- | fs/ceph/snap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 8a43bc8675eb..df04e210a055 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -314,9 +314,9 @@ static int build_snap_context(struct ceph_snap_realm *realm) because we rebuild_snap_realms() works _downward_ in hierarchy after each update.) */ if (realm->cached_context && - realm->cached_context->seq <= realm->seq && + realm->cached_context->seq == realm->seq && (!parent || - realm->cached_context->seq <= parent->cached_context->seq)) { + realm->cached_context->seq >= parent->cached_context->seq)) { dout("build_snap_context %llx %p: %p seq %lld (%d snaps)" " (unchanged)\n", realm->ino, realm, realm->cached_context, |