aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-imx.c
diff options
context:
space:
mode:
authorIlya Dryomov <[email protected]>2023-07-22 20:28:08 +0200
committerIlya Dryomov <[email protected]>2023-07-26 15:08:21 +0200
commit588159009d5b7a09c3e5904cffddbe4a4e170301 (patch)
tree8a818cecf49f7918c52b09a3bef1843a13d525db /drivers/usb/cdns3/cdns3-imx.c
parent8ff2c64c9765446c3cef804fb99da04916603e27 (diff)
rbd: retrieve and check lock owner twice before blocklisting
An attempt to acquire exclusive lock can race with the current lock owner closing the image: 1. lock is held by client123, rbd_lock() returns -EBUSY 2. get_lock_owner_info() returns client123 instance details 3. client123 closes the image, lock is released 4. find_watcher() returns 0 as there is no matching watcher anymore 5. client123 instance gets erroneously blocklisted Particularly impacted is mirror snapshot scheduler in snapshot-based mirroring since it happens to open and close images a lot (images are opened only for as long as it takes to take the next mirror snapshot, the same client instance is used for all images). To reduce the potential for erroneous blocklisting, retrieve the lock owner again after find_watcher() returns 0. If it's still there, make sure it matches the previously detected lock owner. Cc: [email protected] # f38cb9d9c204: rbd: make get_lock_owner_info() return a single locker or NULL Cc: [email protected] # 8ff2c64c9765: rbd: harden get_lock_owner_info() a bit Cc: [email protected] Signed-off-by: Ilya Dryomov <[email protected]> Reviewed-by: Dongsheng Yang <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-imx.c')
0 files changed, 0 insertions, 0 deletions