Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: hch@lst.de, linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCH 2/3] nvmet: on ns size change generate AEN from configfs
Date: Wed, 6 May 2020 09:13:25 +0200	[thread overview]
Message-ID: <20200506071325.GB12145@lst.de> (raw)
In-Reply-To: <20200506014629.39509-3-chaitanya.kulkarni@wdc.com>

On Tue, May 05, 2020 at 06:46:28PM -0700, Chaitanya Kulkarni wrote:
> Add a new attribute resize_check for the namespace which allows users
> to revalidate and generate the AEN if needed. This attribute is needed
> so that we can install userspace rules with systemd service based on
> inotify/fsnotify/uevent. The registered callback for such a service will
> end up writing to this attribute to generate AEN if needed.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  drivers/nvme/target/configfs.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
> index 58cabd7b6fc5..9e6b2e4318e8 100644
> --- a/drivers/nvme/target/configfs.c
> +++ b/drivers/nvme/target/configfs.c
> @@ -543,6 +543,27 @@ static ssize_t nvmet_ns_buffered_io_store(struct config_item *item,
>  
>  CONFIGFS_ATTR(nvmet_ns_, buffered_io);
>  
> +static ssize_t nvmet_ns_resize_check_store(struct config_item *item,
> +		const char *page, size_t count)
> +{
> +	struct nvmet_ns *ns = to_nvmet_ns(item);
> +	bool val;
> +
> +	if (strtobool(page, &val))
> +		return -EINVAL;
> +
> +	if (!val)
> +		return count;
> +
> +	mutex_lock(&ns->subsys->lock);
> +	if (ns->enabled && nvmet_ns_revalidate(ns))
> +		nvmet_ns_changed(ns->subsys, ns->nsid);

I think the nvmet_ns_changed should go into common code, even when
revalidating as part of the identify we should send the AEN.

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2020-05-06  7:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06  1:46 [PATCH 0/3] nvmet: add target ns revalidate support Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 1/3] nvmet: add helper to revalidate bdev and file ns Chaitanya Kulkarni
2020-05-06  7:11   ` Christoph Hellwig
2020-05-06 23:41     ` Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 2/3] nvmet: on ns size change generate AEN from configfs Chaitanya Kulkarni
2020-05-06  7:13   ` Christoph Hellwig [this message]
2020-05-06 23:42     ` Chaitanya Kulkarni
2020-05-06  1:46 ` [PATCH 3/3] nvmet: add async event tracing support Chaitanya Kulkarni
2020-05-06  7:14   ` Christoph Hellwig
2020-05-06 23:43     ` 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=20200506071325.GB12145@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox