]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: Fix multiple logical errors in get_device_id.
authorAlex Zhang <difan@google.com>
Sun, 29 Sep 2019 09:33:58 +0000 (02:33 -0700)
committerYaarit Hatuka <yaarit@redhat.com>
Wed, 4 Mar 2020 03:52:06 +0000 (03:52 +0000)
commit0ba1e7c451d1f000f68e19a09a7300304b81d51d
tree33fef12390d7e90bc7aa955b9e971de4fefbddae
parentf9362acc8c74eda2874aad5bd8af5894024ff8c6
common: Fix multiple logical errors in get_device_id.

0. If blkdev.serial exists, the serial should be used. The original impl seems wrong (if serial does not exist, then use the value from the uninitialized buffer, or even worse, use the value from the last call (model))
1. When using fallback methods, device id should only be returned when both model and serial are present. The original impl looks like a logical error.

Signed-off-by: Difan Zhang <difan@google.com>
(cherry picked from commit 3e09dfd8254abf3c4ff85d6c1b1fafc4b38eae7d)
src/common/blkdev.cc