Project

General

Profile

Bug #18718

Coverty CID 1399582: Integer handling issues (NO_EFFECT)

Added by David Zafman about 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
David Zafman
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

src/ceph/src/osd/PG.cc: 2536 in PG::_update_calc_stats()()
2530 osd_missing = peer_missing[p].num_missing();
2531 object_copies += peer_info[p].stats.stats.sum.num_objects;
2532 }
2533 missing += osd_missing;
2534 // Count non-missing objects not in up as misplaced
2535 if (!in_up)

CID 1399582: Integer handling issues (NO_EFFECT)
This less-than-zero comparison of an unsigned value is never true. "0UL > num_objects - osd_missing".

2536 misplaced += MAX;
2537 } else {
2538 assert(in_up && !in_acting);
2539
2540 // If this peer has more objects then it should, ignore them
2541 backfilled += MIN;

History

#1 Updated by David Zafman about 7 years ago

  • Status changed from New to Fix Under Review

#2 Updated by David Zafman about 7 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF