rbd: harden get_lock_owner_info() a bit
authorIlya Dryomov <idryomov@gmail.com>
Sat, 8 Jul 2023 14:16:59 +0000 (16:16 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 26 Jul 2023 13:08:09 +0000 (15:08 +0200)
commit8ff2c64c9765446c3cef804fb99da04916603e27
tree87805bd178c9f42cf311fc50e406ce6f9e7ef947
parentf38cb9d9c2045dad16eead4a2e1aedfddd94603b
rbd: harden get_lock_owner_info() a bit

- we want the exclusive lock type, so test for it directly
- use sscanf() to actually parse the lock cookie and avoid admitting
  invalid handles
- bail if locker has a blank address

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
drivers/block/rbd.c
net/ceph/messenger.c