]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/ReplicatedPG: avoid dereferencing iterator at end() 2362/head
authorSage Weil <sage@redhat.com>
Sat, 30 Aug 2014 02:16:56 +0000 (19:16 -0700)
committerSage Weil <sage@redhat.com>
Sat, 30 Aug 2014 02:16:56 +0000 (19:16 -0700)
commitded1cf4a93d15ca3be312d296c3ab956109587e3
tree775d12ea0e28c0332e2c4eee6e85d1b710c0b173
parentf807a7ee2cab3d3eb0877e4846580fdbf3a6b3d0
osd/ReplicatedPG: avoid dereferencing iterator at end()

The preceding loop could terminate with p == snapset.clones.end(), which
we assign to dnewest.  We can't dereference the iterator in that case.

For example:

 start_flush ffe627f3/foo/a/test-rados-api-plana05-22080-18/83 v430'42 uv130 blocking
  snapset b=[b,a]:[a,b]+head
 start_flush no older clones

prev_snapc will be 0, oi.snaps will be [a], p will end up at end(), get
assigned to dnewest, and we'll dereference.  It's only sometime harmful
though because we may still take the right (else) branch...

Fixes: #9294
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc