Skip to content

Commit

Permalink
librbd: avoid return usless AioCompletion if "r < numcomp".
Browse files Browse the repository at this point in the history
Signed-off-by: Jianpeng Ma <[email protected]>
  • Loading branch information
majianpeng committed Oct 20, 2017
1 parent 3495126 commit 0479ca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librbd/librbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@ namespace librbd {
int r = librbd::poll_io_events(ictx, cs, numcomp);
tracepoint(librbd, poll_io_events_exit, r);
if (r > 0) {
for (int i = 0; i < numcomp; ++i)
for (int i = 0; i < r; ++i)
comps[i] = (RBD::AioCompletion *)cs[i]->rbd_comp;
}
return r;
Expand Down

0 comments on commit 0479ca2

Please sign in to comment.