osd/ReplicatedPG: fix null deref on rollback_to whiteout check

Bring this whole if/else chain up one level so that we can capture both
ENOENT and whiteout in the same case.  (And don't dereference the
pointer when we know it is NULL.)

Fixes: #6474
Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: stop on read error!

Signed-off-by: Sage Weil <sage@inktank.com>
ceph_test_rados: do not let rollback race with snap delete

Note that the OSD behaves in a weird way when you rollback to a non-
existent snap, so the test probably isn't the only party at fault here.

Fixes (test half of): #6254
Backport: dumpling, cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #688 from ceph/wip-6474

osd/ReplicatedPG: fix null deref on rollback_to whiteout check

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #689 from ceph/wip-6254-model

ceph_test_rados: notice read error; do not race rollback with snap_delete

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge git://github.com/ceph/ceph