]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pg: restore correct behavior of read() callers 11935/head
authorNathan Cutler <ncutler@suse.com>
Sat, 12 Nov 2016 11:37:00 +0000 (12:37 +0100)
committerNathan Cutler <ncutler@suse.com>
Sat, 12 Nov 2016 11:37:00 +0000 (12:37 +0100)
This patch is inspired by fabd6357e42e526d2704d7cb80375c12d731df8d but is not a
cherry-pick.

Fixes: http://tracker.ceph.com/issues/16870
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/osd/ECBackend.cc
src/osd/ReplicatedBackend.cc

index 8f2b571acc44e59094bb5e5215ef7efa72c69f4b..c35a40068837c4f8f976f87e433e2a59a02d027f 100644 (file)
@@ -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();
@@ -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()) {
index 5136fa58a3f3dfeb673a4f9be70f13fa3b2be792..7228a12030ac4904161987d98049383bfb11f9fb 100644 (file)
@@ -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();