diff options
author | Sage Weil <sage@inktank.com> | 2013-01-09 22:34:12 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-01-15 19:25:36 -0800 |
commit | f8a649c0f40f2f7c0a3b957403b5931f5bd4f688 (patch) | |
tree | 55c3efd7f45567e64a3f34859cfd982e774702b6 | |
parent | 8fb0481391be8eb24468f8916fd094ce7fe6ba03 (diff) | |
download | ceph-f8a649c0f40f2f7c0a3b957403b5931f5bd4f688.tar.gz |
osd/ReplicatedPG: validate ino when scrubbing snap collections
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osd/PG.cc | 2 | ||||
-rw-r--r-- | src/osd/PG.h | 2 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 5 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.h | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc index bfcdf7e3d90..c38ab0c5fa2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2687,7 +2687,7 @@ void PG::_scan_list(ScrubMap &map, vector<hobject_t> &ls) osd->store->getattrs(coll, poid, o.attrs); if (poid.snap != CEPH_SNAPDIR && poid.snap != CEPH_NOSNAP) { // Check snap collections - check_snap_collections(poid, o.attrs, &o.snapcolls); + check_snap_collections(st.st_ino, poid, o.attrs, &o.snapcolls); } dout(25) << "_scan_list " << poid << dendl; } else { diff --git a/src/osd/PG.h b/src/osd/PG.h index 0354de800c7..d6dc5912c23 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -775,7 +775,7 @@ public: uint32_t nlinks, ostream &out) { return false; }; virtual void check_snap_collections( - const hobject_t &hoid, + ino_t hino, const hobject_t &hoid, const map<string, bufferptr> &attrs, set<snapid_t> *snapcolls) {}; void clear_scrub_reserved(); diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 8b24fc93b96..d6ff0d2917f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6682,6 +6682,7 @@ bool ReplicatedPG::_report_snap_collection_errors( } void ReplicatedPG::check_snap_collections( + ino_t hino, const hobject_t &hoid, const map<string, bufferptr> &attrs, set<snapid_t> *snapcolls) @@ -6694,7 +6695,9 @@ void ReplicatedPG::check_snap_collections( int r = osd->store->stat(coll_t(info.pgid, *i), hoid, &st); if (r == -ENOENT) { } else if (r == 0) { - snapcolls->insert(*i); + if (hino == st.st_ino) { + snapcolls->insert(*i); + } } else { assert(0); } diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 60aab4b022b..51eaebe0e5f 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -796,7 +796,7 @@ protected: uint32_t nlinks, ostream &out); virtual void check_snap_collections( - const hobject_t &hoid, + ino_t hino, const hobject_t &hoid, const map<string, bufferptr> &attrs, set<snapid_t> *snapcolls); |