CEPH filesystem development
 help / color / mirror / Atom feed
From: Dongsheng Yang <dongsheng.yang@linux.dev>
To: Ilya Dryomov <idryomov@gmail.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] rbd: don't assume rbd_is_lock_owner() for exclusive mappings
Date: Thu, 25 Jul 2024 16:45:37 +0800	[thread overview]
Message-ID: <9c6bdd62-58a4-e660-9e59-f2f999795d9b@linux.dev> (raw)
In-Reply-To: <20240724062914.667734-4-idryomov@gmail.com>



在 2024/7/24 星期三 下午 2:29, Ilya Dryomov 写道:
> Expanding on the previous commit, assuming that rbd_is_lock_owner()
> always returns true (i.e. that we are either in RBD_LOCK_STATE_LOCKED
> or RBD_LOCK_STATE_QUIESCING) if the mapping is exclusive is wrong too.
> In case ceph_cls_set_cookie() fails, the lock would be temporarily
> released even if the mapping is exclusive, meaning that we can end up
> even in RBD_LOCK_STATE_UNLOCKED.
> 
> IOW, exclusive mappings are really "just" about disabling automatic
> lock transitions (as documented in the man page), not about grabbing
> the lock and holding on to it whatever it takes.

Hi Ilya,
	Could you explain more about "disabling atomic lock transitions"? To be 
honest, I was thinking --exclusive means "grabbing
the lock and holding on to it whatever it takes."

Thanx
> 
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>   drivers/block/rbd.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index dc4ddae4f7eb..b8e6700d65f8 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -6589,11 +6589,6 @@ static int rbd_add_acquire_lock(struct rbd_device *rbd_dev)
>   	if (ret)
>   		return ret;
>   
> -	/*
> -	 * The lock may have been released by now, unless automatic lock
> -	 * transitions are disabled.
> -	 */
> -	rbd_assert(!rbd_dev->opts->exclusive || rbd_is_lock_owner(rbd_dev));
>   	return 0;
>   }
>   
> 

  reply	other threads:[~2024-07-25  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  6:29 [PATCH 0/3] rbd: exclusive mapping (-o exclusive) fixes Ilya Dryomov
2024-07-24  6:29 ` [PATCH 1/3] rbd: rename RBD_LOCK_STATE_RELEASING and releasing_wait Ilya Dryomov
2024-07-25  8:46   ` Dongsheng Yang
2024-07-24  6:29 ` [PATCH 2/3] rbd: don't assume RBD_LOCK_STATE_LOCKED for exclusive mappings Ilya Dryomov
2024-07-24  6:29 ` [PATCH 3/3] rbd: don't assume rbd_is_lock_owner() " Ilya Dryomov
2024-07-25  8:45   ` Dongsheng Yang [this message]
2024-07-25  9:31     ` Ilya Dryomov
2024-07-25 10:08       ` Dongsheng Yang
2024-07-25 10:22         ` Ilya Dryomov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c6bdd62-58a4-e660-9e59-f2f999795d9b@linux.dev \
    --to=dongsheng.yang@linux.dev \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox