Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: hch@lst.de, linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCH] nvmet: make ctrl model configurable
Date: Mon, 11 Nov 2019 02:34:21 -0800
Message-ID: <20191111103421.GB6127@infradead.org> (raw)
In-Reply-To: <20191101080855.17970-1-chaitanya.kulkarni@wdc.com>

> +	const char *model = ctrl->subsys->model;

Can we have a little nvme_controller_mode() helper that uses
subsystem->model if it is set, and otherwise the default?  That saves
memory by not duplicating the default name for every subsystem.

> +	kfree(subsys->model);
> +	subsys->model = kstrndup(page, len, GFP_KERNEL);
> +	if (!subsys->model)
> +		ret = -ENOMEM;

I don't think we should free the old model until the new one
is allocated.

Otherwise this looks good to me, but can someone also prepare a
nvmetcli patch as well?

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

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01  8:08 Chaitanya Kulkarni
2019-11-11 10:34 ` Christoph Hellwig [this message]
2019-11-11 13:31   ` Mark Ruijter
2019-11-12  7:07     ` Chaitanya Kulkarni
2019-11-12  7:06   ` Chaitanya Kulkarni
2019-11-11 11:09 ` Mark Ruijter
  -- strict thread matches above, loose matches on Subject: below --
2019-10-30 19:48 Chaitanya Kulkarni
2019-10-30 20:08 ` Mark Ruijter
2019-10-30 20:09   ` Chaitanya Kulkarni
2019-10-30 21: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=20191111103421.GB6127@infradead.org \
    --to=hch@infradead.org \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --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

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git