Skip to content

Commit

Permalink
Merge pull request #11935: hammer: osd: crash on EIO during deep-scru…
Browse files Browse the repository at this point in the history
…bbing

Reviewed-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Nov 20, 2016
2 parents 6609bbb + fc46591 commit f289f48
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 f289f48

Please sign in to comment.