Commit 2237ceb
committed
rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings
Every time a watch is reestablished after getting lost, we need to
update the cookie which involves quiescing exclusive lock. For this,
we transition from RBD_LOCK_STATE_LOCKED to RBD_LOCK_STATE_QUIESCING
roughly for the duration of rbd_reacquire_lock() call. If the mapping
is exclusive and I/O happens to arrive in this time window, it's failed
with EROFS (later translated to EIO) based on the wrong assumption in
rbd_img_exclusive_lock() -- "lock got released?" check there stopped
making sense with commit a2b1da0 ("rbd: lock should be quiesced on
reacquire").
To make it worse, any such I/O is added to the acquiring list before
EROFS is returned and this sets up for violating rbd_lock_del_request()
precondition that the request is either on the running list or not on
any list at all -- see commit ded080c ("rbd: don't move requests
to the running list on errors"). rbd_lock_del_request() ends up
processing these requests as if they were on the running list which
screws up quiescing_wait completion counter and ultimately leads to
rbd_assert(!completion_done(&rbd_dev->quiescing_wait));
being triggered on the next watch error.
Cc: [email protected] # 06ef84c4e9c4: rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait
Cc: [email protected]
Fixes: 637cd06 ("rbd: new exclusive lock wait/wake code")
Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Dongsheng Yang <[email protected]>1 parent f5c466a commit 2237ceb
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3457 | 3457 | | |
3458 | 3458 | | |
3459 | 3459 | | |
| 3460 | + | |
3460 | 3461 | | |
3461 | 3462 | | |
3462 | 3463 | | |
| |||
3476 | 3477 | | |
3477 | 3478 | | |
3478 | 3479 | | |
3479 | | - | |
3480 | | - | |
3481 | | - | |
3482 | | - | |
3483 | | - | |
3484 | 3480 | | |
3485 | 3481 | | |
3486 | 3482 | | |
| |||
4601 | 4597 | | |
4602 | 4598 | | |
4603 | 4599 | | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
4604 | 4604 | | |
4605 | 4605 | | |
4606 | 4606 | | |
| |||
0 commit comments