Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Dmitry Bogdanov <d.bogdanov@yadro.com>
Cc: hch@lst.de, sagi@grimberg.me, kch@nvidia.com,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH v9 1/1] nvmet: support reservation feature
Date: Tue, 24 Sep 2024 17:45:12 +0800	[thread overview]
Message-ID: <68e3d62e-0f35-4b1b-9d46-b8e7ff0110b5@linux.alibaba.com> (raw)
In-Reply-To: <20240924082425.GF22571@yadro.com>


在 2024/9/24 16:24, Dmitry Bogdanov 写道:
>> I take a look again, if we set self new holder before call
>> nvmet_pr_unreg_all_others_by_prkey(), the
>> nvmet_pr_unreg_all_others_by_prkey() will
>>
>> not unregister self, so this will not goto nvmet_pr_unregister_one()'s
>> calling nvmet_pr_resv_released().
> Yes, and this is a reason not to try to fix non-atomicity (anothter my
> comment) by setting new holder before unregistering.
>
> Regarding this place, here nvmet_pr_resv_released should be called for
> original_rtype !=*_REG_ONLY with a note that _REG_ONLY handled in nvmet_pr_unregister_one.
>
> Please, do not take my suggestions "how to fix" as a direct order, it's
> just suggestion.
>
I'm a little confused, if we dont set new holder before unregistering,

how do we fix the non-atomicity problem?

My opinion is that setting current host to holder first can not only

make sure that during unregistering other host can not access, but also

ensure that nvmet_pr_unregister_one will not unregiter the new holder(In 
nvmet_pr_unreg_all_others_by_prkey, I exclude current host),

so that we dont need to worry about doule call nvmet_pr_resv_released.



  reply	other threads:[~2024-09-24  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23  9:47 [PATCH v9 0/1] Implement the NVMe reservation feature Guixin Liu
2024-09-23  9:47 ` [PATCH v9 1/1] nvmet: support " Guixin Liu
2024-09-23 16:32   ` Dmitry Bogdanov
2024-09-24  2:49     ` Guixin Liu
2024-09-24  5:54       ` Dmitry Bogdanov
2024-09-24  6:18         ` Guixin Liu
2024-09-24  6:38           ` Guixin Liu
2024-09-24  8:24             ` Dmitry Bogdanov
2024-09-24  9:45               ` Guixin Liu [this message]
2024-09-24 12:57                 ` Dmitry Bogdanov

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=68e3d62e-0f35-4b1b-9d46-b8e7ff0110b5@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=d.bogdanov@yadro.com \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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