mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
Merge pull request #18015 from tchaikov/wip-kill-warnings
osd,os/bluestore: kill clang analyzer warnings Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
583f62bd98
@ -4901,8 +4901,6 @@ int BlueStore::_balance_bluefs_freespace(PExtentVector *extents)
|
||||
dout(1) << __func__ << " gifting " << e << " to bluefs" << dendl;
|
||||
extents->push_back(e);
|
||||
}
|
||||
gift = 0;
|
||||
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@ -10008,16 +10006,15 @@ int BlueStore::_do_alloc_write(
|
||||
bufferlist *l = &wi.bl;
|
||||
uint64_t final_length = wi.blob_length;
|
||||
uint64_t csum_length = wi.blob_length;
|
||||
unsigned csum_order = block_size_order;
|
||||
if (wi.compressed) {
|
||||
final_length = wi.compressed_bl.length();
|
||||
csum_length = final_length;
|
||||
csum_order = ctz(csum_length);
|
||||
l = &wi.compressed_bl;
|
||||
dblob.set_compressed(wi.blob_length, wi.compressed_len);
|
||||
} else if (wi.new_blob) {
|
||||
// initialize newly created blob only
|
||||
assert(dblob.is_mutable());
|
||||
unsigned csum_order;
|
||||
if (l->length() != wi.blob_length) {
|
||||
// hrm, maybe we could do better here, but let's not bother.
|
||||
dout(20) << __func__ << " forcing csum_order to block_size_order "
|
||||
|
@ -1656,7 +1656,6 @@ int FileStore::mount()
|
||||
|
||||
// check fsid with omap
|
||||
// get omap fsid
|
||||
int omap_fsid_fd;
|
||||
char omap_fsid_buf[PATH_MAX];
|
||||
struct ::stat omap_fsid_stat;
|
||||
snprintf(omap_fsid_buf, sizeof(omap_fsid_buf), "%s/osd_uuid", omap_dir.c_str());
|
||||
@ -1665,7 +1664,8 @@ int FileStore::mount()
|
||||
dout(10) << __FUNC__ << ": osd_uuid not found under omap, "
|
||||
<< "assume as matched."
|
||||
<< dendl;
|
||||
}else{
|
||||
} else {
|
||||
int omap_fsid_fd;
|
||||
// if osd_uuid exists, compares osd_uuid with fsid
|
||||
omap_fsid_fd = ::open(omap_fsid_buf, O_RDONLY, 0644);
|
||||
if (omap_fsid_fd < 0) {
|
||||
@ -1677,7 +1677,6 @@ int FileStore::mount()
|
||||
}
|
||||
ret = read_fsid(omap_fsid_fd, &omap_fsid);
|
||||
VOID_TEMP_FAILURE_RETRY(::close(omap_fsid_fd));
|
||||
omap_fsid_fd = -1; // defensive
|
||||
if (ret < 0) {
|
||||
derr << __FUNC__ << ": error reading omap_fsid_fd"
|
||||
<< ", omap_fsid = " << omap_fsid
|
||||
|
@ -3537,12 +3537,12 @@ int OSD::update_crush_device_class()
|
||||
string("\"ids\": [\"") + stringify(whoami) + string("\"]}");
|
||||
|
||||
r = mon_cmd_maybe_osd_create(cmd);
|
||||
// the above cmd can fail for various reasons, e.g.:
|
||||
// (1) we are connecting to a pre-luminous monitor
|
||||
// (2) user manually specify a class other than
|
||||
// 'ceph-disk prepare --crush-device-class'
|
||||
// simply skip result-checking for now
|
||||
return 0;
|
||||
if (r == -EBUSY) {
|
||||
// good, already bound to a device-class
|
||||
return 0;
|
||||
} else {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
void OSD::write_superblock(ObjectStore::Transaction& t)
|
||||
|
@ -87,7 +87,6 @@ int PoolDump::dump(IoCtx *io_ctx)
|
||||
|
||||
if (outdata.length() < op_size) {
|
||||
// No more data
|
||||
r = 0;
|
||||
break;
|
||||
}
|
||||
offset += outdata.length();
|
||||
@ -151,7 +150,6 @@ int PoolDump::dump(IoCtx *io_ctx)
|
||||
}
|
||||
r = values.size();
|
||||
} while (r == MAX_READ);
|
||||
r = 0;
|
||||
|
||||
// Close object
|
||||
// =============
|
||||
|
Loading…
Reference in New Issue
Block a user