Merge pull request from xiexingguo/xxg-wip-fixdc

os/filestore: fix result handling logic of destroy_collection

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-03-17 21:55:11 -04:00
commit 3ea63bbecf

View File

@ -1343,7 +1343,6 @@ int FileStore::mount()
ret = read_superblock();
if (ret < 0) {
ret = -EINVAL;
goto close_fsid_fd;
}
@ -3013,7 +3012,7 @@ int FileStore::read(
if (m_filestore_sloppy_crc && (!replaying || backend->can_checkpoint())) {
ostringstream ss;
int errors = backend->_crc_verify_read(**fd, offset, got, bl, &ss);
if (errors > 0) {
if (errors != 0) {
dout(0) << "FileStore::read " << cid << "/" << oid << " " << offset << "~"
<< got << " ... BAD CRC:\n" << ss.str() << dendl;
assert(0 == "bad crc on read");
@ -3436,7 +3435,11 @@ int FileStore::_do_sparse_copy_range(int from, int to, uint64_t srcoff, uint64_t
r = _do_fiemap(from, srcoff, len, &exomap);
}
int64_t written = 0;
int64_t written = 0;
if (r < 0)
goto out;
for (map<uint64_t, uint64_t>::iterator miter = exomap.begin(); miter != exomap.end(); ++miter) {
uint64_t it_off = miter->first - srcoff + dstoff;
r = _do_copy_range(from, to, miter->first, miter->second, it_off, true);
@ -3956,7 +3959,6 @@ int FileStore::snapshot(const string& name)
int r = backend->create_checkpoint(s, NULL);
if (r) {
r = -errno;
derr << "snapshot " << name << " failed: " << cpp_strerror(r) << dendl;
}
@ -4172,7 +4174,6 @@ int FileStore::getattrs(const coll_t& _cid, const ghobject_t& oid, map<string,bu
if (r < 0) {
goto out;
}
lfn_close(fd);
if (!spill_out) {
dout(10) << __func__ << " no xattr exists in object_map r = " << r << dendl;
@ -4393,8 +4394,10 @@ int FileStore::_rmattrs(const coll_t& cid, const ghobject_t& oid,
char n[CHAIN_XATTR_MAX_NAME_LEN];
get_attrname(p->first.c_str(), n, CHAIN_XATTR_MAX_NAME_LEN);
r = chain_fremovexattr(**fd, n);
if (r < 0)
break;
if (r < 0) {
dout(10) << __func__ << " could not remove xattr r = " << r << dendl;
goto out_close;
}
}
}