Commit 9d01e07
committed
rbd: prevent busy loop when requesting exclusive lock
Due to rbd_try_acquire_lock() effectively swallowing all but
EBLOCKLISTED error from rbd_try_lock() ("request lock anyway") and
rbd_request_lock() returning ETIMEDOUT error not only for an actual
notify timeout but also when the lock owner doesn't respond, a busy
loop inside of rbd_acquire_lock() between rbd_try_acquire_lock() and
rbd_request_lock() is possible.
Requesting the lock on EBUSY error (returned by get_lock_owner_info()
if an incompatible lock or invalid lock owner is detected) makes very
little sense. The same goes for ETIMEDOUT error (might pop up pretty
much anywhere if osd_request_timeout option is set) and many others.
Just fail I/O requests on rbd_dev->acquiring_list immediately on any
error from rbd_try_lock().
Cc: stable@vger.kernel.org # 5881590: rbd: retrieve and check lock owner twice before blocklisting
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>1 parent e7e607b commit 9d01e07
1 file changed
Lines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3675 | 3675 | | |
3676 | 3676 | | |
3677 | 3677 | | |
3678 | | - | |
| 3678 | + | |
3679 | 3679 | | |
3680 | 3680 | | |
3681 | 3681 | | |
| |||
3878 | 3878 | | |
3879 | 3879 | | |
3880 | 3880 | | |
3881 | | - | |
| 3881 | + | |
3882 | 3882 | | |
3883 | 3883 | | |
3884 | 3884 | | |
| |||
3940 | 3940 | | |
3941 | 3941 | | |
3942 | 3942 | | |
3943 | | - | |
| 3943 | + | |
| 3944 | + | |
3944 | 3945 | | |
| 3946 | + | |
3945 | 3947 | | |
3946 | 3948 | | |
3947 | 3949 | | |
| |||
3985 | 3987 | | |
3986 | 3988 | | |
3987 | 3989 | | |
3988 | | - | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
3989 | 3994 | | |
| 3995 | + | |
3990 | 3996 | | |
3991 | 3997 | | |
3992 | 3998 | | |
| |||
4089 | 4095 | | |
4090 | 4096 | | |
4091 | 4097 | | |
4092 | | - | |
4093 | | - | |
4094 | | - | |
4095 | | - | |
4096 | | - | |
| 4098 | + | |
| 4099 | + | |
4097 | 4100 | | |
4098 | 4101 | | |
4099 | 4102 | | |
| |||
6627 | 6630 | | |
6628 | 6631 | | |
6629 | 6632 | | |
6630 | | - | |
6631 | 6633 | | |
6632 | | - | |
6633 | | - | |
6634 | | - | |
| 6634 | + | |
6635 | 6635 | | |
| 6636 | + | |
| 6637 | + | |
6636 | 6638 | | |
6637 | 6639 | | |
6638 | 6640 | | |
| |||
0 commit comments