Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCHv2] nvme: ANA transition timeout handling
Date: Mon, 11 Jun 2018 16:22:05 +0200	[thread overview]
Message-ID: <20180611142205.GA13515@lst.de> (raw)
In-Reply-To: <20180608121320.74149-1-hare@suse.de>

> +			/*
> +			 * Use timer_reduce() to ensure we're not modifying
> +			 * an already running timer.
> +			 */
> +			timer_reduce(&grp->anatt_timer,
> +				     ns->ctrl->anatt * HZ + jiffies);

That's a bit of a gross hack for a timer that never is actually
reduced, just added.

> +		if (ctrl->state == NVME_CTRL_LIVE && state == NVME_ANA_CHANGE)
> +			timer_reduce(&grp->anatt_timer,
> +				     ctrl->anatt * HZ + jiffies);
> +		else
> +			del_timer(&grp->anatt_timer);


> +	for (grpid = 0; grpid < ctrl->anagrpmax; grpid++) {
> +		struct nvme_ana_group *grp = &ctrl->ana_groups[grpid];
> +
> +		del_timer(&grp->anatt_timer);

Without del_timer_sync you are going to create use after free
conditions.


Anyway, v4 of the ANA series I've just sent contains simple ANATT
handling based on a per-controller timer, which should be sufficient
to catch the intent behind ANATT.  Comments welcome.

  reply	other threads:[~2018-06-11 14:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 12:13 [PATCHv2] nvme: ANA transition timeout handling Hannes Reinecke
2018-06-11 14:22 ` Christoph Hellwig [this message]
2018-06-11 15:51   ` Hannes Reinecke

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=20180611142205.GA13515@lst.de \
    --to=hch@lst.de \
    /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