]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: detach_bucket must test item >= 0 not > 0 913/head
authorLoic Dachary <loic@dachary.org>
Fri, 6 Dec 2013 23:31:54 +0000 (00:31 +0100)
committerLoic Dachary <loic@dachary.org>
Fri, 6 Dec 2013 23:31:54 +0000 (00:31 +0100)
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 <loic@dachary.org>
src/crush/CrushWrapper.h

index 9f5cbdfd3a63f63c92efa9fdca7772d1b29ae8ba..c9bb37c93441cb2b189b90e6ff3175f5f43b0ead 100644 (file)
@@ -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