Skip to content

Commit

Permalink
Merge pull request #11935 from SUSE/wip-16870-hammer
Browse files Browse the repository at this point in the history
hammer: osd: crash on EIO during deep-scrubbing

Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
smithfarm committed Nov 23, 2016
2 parents 8a15ac7 + fc46591 commit d7fc569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/osd/ECBackend.cc
Expand Up @@ -1778,6 +1778,9 @@ void ECBackend::be_deep_scrub(
if (stride % sinfo.get_chunk_size())
stride += sinfo.get_chunk_size() - (stride % sinfo.get_chunk_size());
uint64_t pos = 0;

uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL | CEPH_OSD_OP_FLAG_FADVISE_DONTNEED;

while (true) {
bufferlist bl;
handle.reset_tp_timeout();
Expand All @@ -1787,7 +1790,7 @@ void ECBackend::be_deep_scrub(
poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
pos,
stride, bl,
true);
fadvise_flags, true);
if (r < 0)
break;
if (bl.length() % sinfo.get_chunk_size()) {
Expand Down
5 changes: 4 additions & 1 deletion src/osd/ReplicatedBackend.cc
Expand Up @@ -750,13 +750,16 @@ void ReplicatedBackend::be_deep_scrub(
bufferlist bl, hdrbl;
int r;
__u64 pos = 0;

uint32_t fadvise_flags = CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL | CEPH_OSD_OP_FLAG_FADVISE_DONTNEED;

while ( (r = store->read(
coll,
ghobject_t(
poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
pos,
cct->_conf->osd_deep_scrub_stride, bl,
true)) > 0) {
fadvise_flags, true)) > 0) {
handle.reset_tp_timeout();
h << bl;
pos += bl.length();
Expand Down

0 comments on commit d7fc569

Please sign in to comment.