From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: sagi@grimberg.me, linux-nvme@lists.infradead.org, hch@lst.de
Subject: Re: [PATCH 5/6] nvmet: centralize port enable access for configfs
Date: Wed, 22 Apr 2020 10:32:07 +0200 [thread overview]
Message-ID: <20200422083207.GB25341@lst.de> (raw)
In-Reply-To: <20200419235242.60355-6-chaitanya.kulkarni@wdc.com>
> +static bool nvmet_is_port_enabled(struct nvmet_port *p, const char *caller)
> +{
> + bool enabled;
> +
> + /*
> + * Right now port->enabled is accessed in follwoing two code paths
> + * which are protected by the nvmet_config_sem :-
> + * 1. nvmet_subsys allow/drop link() -> nvmet_port_enable/disable()
> + * setting port->enabled true/false respectively.
> + * 2. nvmet_referral_enable/disable() -> nvmet_port_enable/disable()
> + * setting port->enabled true/false respectively.
> + * Use read nvmet_config_sem when reading enable condition.
> + */
> + down_read(&nvmet_config_sem);
> + enabled = p->enabled;
> + up_read(&nvmet_config_sem);
Taking a lock around checking a single scalar value is rather pointless.
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-04-22 8:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 23:52 [PATCH 0/6] nvmet: configfs code clenaup and fix Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 1/6] nvmet: add generic type-name mapping Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 2/6] nvmet: use type-name map for address family Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 3/6] nvmet: use type-name map for ana states Chaitanya Kulkarni
2020-04-22 8:31 ` Christoph Hellwig
2020-04-19 23:52 ` [PATCH 4/6] nvmet: use type-name map for address treq Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 5/6] nvmet: centralize port enable access for configfs Chaitanya Kulkarni
2020-04-22 8:32 ` Christoph Hellwig [this message]
2020-04-23 6:07 ` Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 6/6] nvmet: align addrfam list to spec Chaitanya Kulkarni
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=20200422083207.GB25341@lst.de \
--to=hch@lst.de \
--cc=chaitanya.kulkarni@wdc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.