From: Zhiqiang Wang Date: Thu, 23 Apr 2015 02:34:37 +0000 (+0800) Subject: os/NewStore: data_map shouldn't be empty when writing all overlays X-Git-Tag: v9.1.0~242^2~45 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b1136fbd33936e355f332ae9535aa19a85c37211;p=ceph.git os/NewStore: data_map shouldn't be empty when writing all overlays This should be an assert instead of creating new data_map. Signed-off-by: Zhiqiang Wang --- diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index e39fbbfbe9be..d501943b9931 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -3098,20 +3098,6 @@ int NewStore::_do_write_all_overlays(TransContext *txc, if (o->onode.overlay_map.empty()) return 0; - // overwrite to new fid - if (o->onode.data_map.empty()) { - // create - fragment_t &f = o->onode.data_map[0]; - f.offset = 0; - f.length = o->onode.size; - int fd = _create_fid(txc, &f.fid, O_RDWR); - if (fd < 0) { - return fd; - } - VOID_TEMP_FAILURE_RETRY(::close(fd)); - dout(20) << __func__ << " create " << f.fid << dendl; - } - assert(o->onode.data_map.size() == 1); fragment_t& f = o->onode.data_map.begin()->second; assert(f.offset == 0);