Skip to content

Commit 13bdc5a

Browse files
authored
Merge pull request ceph#62273 from aclamk/wip-aclamk-osd-superblock-corruption-resilient
osd/OSD.cc: make osd_superblock recovery more robust
2 parents 8ad480d + aecabff commit 13bdc5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/osd/OSD.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,7 @@ void OSD::write_superblock(CephContext* cct, OSDSuperblock& sb, ObjectStore::Tra
21342134

21352135
bufferlist bl;
21362136
encode(sb, bl);
2137+
t.truncate(coll_t::meta(), OSD_SUPERBLOCK_GOBJECT, 0);
21372138
t.write(coll_t::meta(), OSD_SUPERBLOCK_GOBJECT, 0, bl.length(), bl);
21382139
std::map<std::string, ceph::buffer::list> attrs;
21392140
attrs.emplace(OSD_SUPERBLOCK_OMAP_KEY, bl);

0 commit comments

Comments
 (0)