Skip to content

Commit fab21c5

Browse files
committed
rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.35.1.el9_4 commit-author Ilya Dryomov <idryomov@gmail.com> commit f5c466a ... to RBD_LOCK_STATE_QUIESCING and quiescing_wait to recognize that this state and the associated completion are backing rbd_quiesce_lock(), which isn't specific to releasing the lock. While exclusive lock does get quiesced before it's released, it also gets quiesced before an attempt to update the cookie is made and there the lock is not released as long as ceph_cls_set_cookie() succeeds. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn> (cherry picked from commit f5c466a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent d223f79 commit fab21c5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/block/rbd.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ enum rbd_watch_state {
362362
enum rbd_lock_state {
363363
RBD_LOCK_STATE_UNLOCKED,
364364
RBD_LOCK_STATE_LOCKED,
365-
RBD_LOCK_STATE_RELEASING,
365+
RBD_LOCK_STATE_QUIESCING,
366366
};
367367

368368
/* WatchNotify::ClientId */
@@ -422,7 +422,7 @@ struct rbd_device {
422422
struct list_head running_list;
423423
struct completion acquire_wait;
424424
int acquire_err;
425-
struct completion releasing_wait;
425+
struct completion quiescing_wait;
426426

427427
spinlock_t object_map_lock;
428428
u8 *object_map;
@@ -525,7 +525,7 @@ static bool __rbd_is_lock_owner(struct rbd_device *rbd_dev)
525525
lockdep_assert_held(&rbd_dev->lock_rwsem);
526526

527527
return rbd_dev->lock_state == RBD_LOCK_STATE_LOCKED ||
528-
rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING;
528+
rbd_dev->lock_state == RBD_LOCK_STATE_QUIESCING;
529529
}
530530

531531
static bool rbd_is_lock_owner(struct rbd_device *rbd_dev)
@@ -3458,12 +3458,12 @@ static void rbd_lock_del_request(struct rbd_img_request *img_req)
34583458
spin_lock(&rbd_dev->lock_lists_lock);
34593459
if (!list_empty(&img_req->lock_item)) {
34603460
list_del_init(&img_req->lock_item);
3461-
need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING &&
3461+
need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_QUIESCING &&
34623462
list_empty(&rbd_dev->running_list));
34633463
}
34643464
spin_unlock(&rbd_dev->lock_lists_lock);
34653465
if (need_wakeup)
3466-
complete(&rbd_dev->releasing_wait);
3466+
complete(&rbd_dev->quiescing_wait);
34673467
}
34683468

34693469
static int rbd_img_exclusive_lock(struct rbd_img_request *img_req)
@@ -4181,16 +4181,16 @@ static bool rbd_quiesce_lock(struct rbd_device *rbd_dev)
41814181
/*
41824182
* Ensure that all in-flight IO is flushed.
41834183
*/
4184-
rbd_dev->lock_state = RBD_LOCK_STATE_RELEASING;
4185-
rbd_assert(!completion_done(&rbd_dev->releasing_wait));
4184+
rbd_dev->lock_state = RBD_LOCK_STATE_QUIESCING;
4185+
rbd_assert(!completion_done(&rbd_dev->quiescing_wait));
41864186
if (list_empty(&rbd_dev->running_list))
41874187
return true;
41884188

41894189
up_write(&rbd_dev->lock_rwsem);
4190-
wait_for_completion(&rbd_dev->releasing_wait);
4190+
wait_for_completion(&rbd_dev->quiescing_wait);
41914191

41924192
down_write(&rbd_dev->lock_rwsem);
4193-
if (rbd_dev->lock_state != RBD_LOCK_STATE_RELEASING)
4193+
if (rbd_dev->lock_state != RBD_LOCK_STATE_QUIESCING)
41944194
return false;
41954195

41964196
rbd_assert(list_empty(&rbd_dev->running_list));
@@ -5383,7 +5383,7 @@ static struct rbd_device *__rbd_dev_create(struct rbd_client *rbdc,
53835383
INIT_LIST_HEAD(&rbd_dev->acquiring_list);
53845384
INIT_LIST_HEAD(&rbd_dev->running_list);
53855385
init_completion(&rbd_dev->acquire_wait);
5386-
init_completion(&rbd_dev->releasing_wait);
5386+
init_completion(&rbd_dev->quiescing_wait);
53875387

53885388
spin_lock_init(&rbd_dev->object_map_lock);
53895389

0 commit comments

Comments
 (0)