From: Loic Dachary Date: Fri, 6 Dec 2013 23:31:54 +0000 (+0100) Subject: crush: detach_bucket must test item >= 0 not > 0 X-Git-Tag: v0.74~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F913%2Fhead;p=ceph.git crush: detach_bucket must test item >= 0 not > 0 Since detach_bucket is a private helper solely used by move_bucket which contains another ( correct ) safeguard, the code cannot be reached and the problem can never happen. If another function uses detach_bucket, it may happen. Signed-off-by: Loic Dachary --- diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 9f5cbdfd3a6..c9bb37c9344 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -620,7 +620,7 @@ private: if (!crush) return (-EINVAL); - if (item > 0) + if (item >= 0) return (-EINVAL); // check that the bucket that we want to detach exists