From 168fa1a0ecbe782e4fd882e4841ec31286c2da2b Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 24 May 2017 16:02:10 -0700 Subject: [PATCH] objectstore: Remove allow_eio arg from read, we allow it to be returned Signed-off-by: David Zafman --- src/os/ObjectStore.h | 8 +++----- src/os/bluestore/BlueStore.cc | 9 +++------ src/os/bluestore/BlueStore.h | 6 ++---- src/os/filestore/FileStore.cc | 7 +------ src/os/filestore/FileStore.h | 3 +-- src/os/kstore/KStore.cc | 3 +-- src/os/kstore/KStore.h | 3 +-- src/os/memstore/MemStore.cc | 8 +++----- src/os/memstore/MemStore.h | 6 ++---- src/osd/ECBackend.cc | 5 ++--- src/osd/ReplicatedBackend.cc | 2 +- 11 files changed, 20 insertions(+), 40 deletions(-) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 71f5e80b17c5..caf2bb779c64 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1702,17 +1702,15 @@ public: uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) = 0; + uint32_t op_flags = 0) = 0; virtual int read( CollectionHandle &c, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) { - return read(c->get_cid(), oid, offset, len, bl, op_flags, allow_eio); + uint32_t op_flags = 0) { + return read(c->get_cid(), oid, offset, len, bl, op_flags); } /** diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 38d1e272ebc5..8861636327c9 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6154,13 +6154,12 @@ int BlueStore::read( uint64_t offset, size_t length, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { CollectionHandle c = _get_collection(cid); if (!c) return -ENOENT; - return read(c, oid, offset, length, bl, op_flags, allow_eio); + return read(c, oid, offset, length, bl, op_flags); } int BlueStore::read( @@ -6169,8 +6168,7 @@ int BlueStore::read( uint64_t offset, size_t length, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { utime_t start = ceph_clock_now(); Collection *c = static_cast(c_.get()); @@ -6200,7 +6198,6 @@ int BlueStore::read( } out: - assert(allow_eio || r != -EIO); if (r == 0 && _debug_data_eio(oid)) { r = -EIO; derr << __func__ << " " << c->cid << " " << oid << " INJECT EIO" << dendl; diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 1114e7b4f47c..19ab8bb28154 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -2184,16 +2184,14 @@ public: uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; int read( CollectionHandle &c, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; int _do_read( Collection *c, OnodeRef o, diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 1fb4839455ee..d2f3053195f2 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -3183,8 +3183,7 @@ int FileStore::read( uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { int got; tracepoint(objectstore, read_enter, _cid.c_str(), offset, len); @@ -3220,10 +3219,6 @@ int FileStore::read( if (got < 0) { dout(10) << __FUNC__ << ": (" << cid << "/" << oid << ") pread error: " << cpp_strerror(got) << dendl; lfn_close(fd); - if (!(allow_eio || !m_filestore_fail_eio || got != -EIO)) { - derr << __FUNC__ << ": (" << cid << "/" << oid << ") pread error: " << cpp_strerror(got) << dendl; - assert(0 == "eio on pread"); - } return got; } bptr.set_length(got); // properly size the buffer diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index 88a1d3170d08..e7cf4cdf6af7 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -586,8 +586,7 @@ public: uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; int _do_fiemap(int fd, uint64_t offset, size_t len, map *m); int _do_seek_hole_data(int fd, uint64_t offset, size_t len, diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index b06b06865d48..f7a4214a83e2 100755 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -1169,8 +1169,7 @@ int KStore::read( uint64_t offset, size_t length, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { dout(15) << __func__ << " " << cid << " " << oid << " " << offset << "~" << length diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index bfa1197339f7..7570756a7133 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -461,8 +461,7 @@ public: uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; int _do_read( OnodeRef o, uint64_t offset, diff --git a/src/os/memstore/MemStore.cc b/src/os/memstore/MemStore.cc index 4b1ca248a435..08be76e65b4b 100644 --- a/src/os/memstore/MemStore.cc +++ b/src/os/memstore/MemStore.cc @@ -316,13 +316,12 @@ int MemStore::read( uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { CollectionHandle c = get_collection(cid); if (!c) return -ENOENT; - return read(c, oid, offset, len, bl, op_flags, allow_eio); + return read(c, oid, offset, len, bl, op_flags); } int MemStore::read( @@ -331,8 +330,7 @@ int MemStore::read( uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags, - bool allow_eio) + uint32_t op_flags) { Collection *c = static_cast(c_.get()); dout(10) << __func__ << " " << c->cid << " " << oid << " " diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h index 8bf5cc76a5ef..e17574cc0f5f 100644 --- a/src/os/memstore/MemStore.h +++ b/src/os/memstore/MemStore.h @@ -298,16 +298,14 @@ public: uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; int read( CollectionHandle &c, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl, - uint32_t op_flags = 0, - bool allow_eio = false) override; + uint32_t op_flags = 0) override; using ObjectStore::fiemap; int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) override; int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, map& destmap) override; diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 7097dda482d8..166edc65996f 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1004,8 +1004,7 @@ void ECBackend::handle_sub_read( ghobject_t(i->first, ghobject_t::NO_GEN, shard), j->get<0>(), j->get<1>(), - bl, j->get<2>(), - true); // Allow EIO return + bl, j->get<2>()); if (r < 0) { get_parent()->clog_error() << __func__ << ": Error " << r @@ -2404,7 +2403,7 @@ void ECBackend::be_deep_scrub( poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), pos, stride, bl, - fadvise_flags, true); + fadvise_flags); if (r < 0) break; if (bl.length() % sinfo.get_chunk_size()) { diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 5161ca6fe270..4e9ea976f29e 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -725,7 +725,7 @@ void ReplicatedBackend::be_deep_scrub( poid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), pos, cct->_conf->osd_deep_scrub_stride, bl, - fadvise_flags, true); + fadvise_flags); if (r <= 0) break; -- 2.47.3