All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	dm-devel@lists.linux.dev
Subject: Re: [PATCH 1/3] dm: move setting zoned_enabled to dm_table_set_restrictions
Date: Fri, 24 May 2024 11:07:59 -0400	[thread overview]
Message-ID: <ZlCtT0FadH4I8dFb@kernel.org> (raw)
In-Reply-To: <20240524142929.817565-2-hch@lst.de>

On Fri, May 24, 2024 at 04:29:09PM +0200, Christoph Hellwig wrote:
> Keep it together with the rest of the zoned code.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/md/dm-table.c | 3 ---
>  drivers/md/dm-zone.c  | 8 +++++++-
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index cc66a27c363a65..e291b78b307b13 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -2040,9 +2040,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
>  		r = dm_set_zones_restrictions(t, q);
>  		if (r)
>  			return r;
> -		if (blk_queue_is_zoned(q) &&
> -		    !static_key_enabled(&zoned_enabled.key))
> -			static_branch_enable(&zoned_enabled);
>  	}
>  
>  	dm_update_crypto_profile(q, t);
> diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c
> index 8e6bcb0d786a1a..eb1165324ab047 100644
> --- a/drivers/md/dm-zone.c
> +++ b/drivers/md/dm-zone.c
> @@ -287,7 +287,13 @@ int dm_set_zones_restrictions(struct dm_table *t, struct request_queue *q)
>  		       queue_emulates_zone_append(q) ? "emulated" : "native");
>  	}
>  
> -	return dm_revalidate_zones(md, t);
> +	ret = dm_revalidate_zones(md, t);
> +	if (ret < 0)
> +		return 0;

Not following why you're return 0 if r < 0.

blk_revalidate_disk_zones() has quite a few negative checks that
return regular error codes, so why drop those validation errors?

> +
> +	if (!static_key_enabled(&zoned_enabled.key))
> +		static_branch_enable(&zoned_enabled);
> +	return 0;
>  }
>  
>  /*
> -- 
> 2.43.0
> 

  reply	other threads:[~2024-05-24 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 14:29 convert newly added dm-zone code to the atomic queue commit API Christoph Hellwig
2024-05-24 14:29 ` [PATCH 1/3] dm: move setting zoned_enabled to dm_table_set_restrictions Christoph Hellwig
2024-05-24 15:07   ` Mike Snitzer [this message]
2024-05-24 16:40     ` Christoph Hellwig
2024-05-24 14:29 ` [PATCH 2/3] dm: remove dm_check_zoned Christoph Hellwig
2024-05-24 15:09   ` Mike Snitzer
2024-05-24 14:29 ` [PATCH 3/3] dm: make dm_set_zones_restrictions work on the queue limits Christoph Hellwig
2024-05-24 15:15   ` Mike Snitzer
2024-05-24 16:41     ` Christoph Hellwig
2024-05-24 15:17 ` convert newly added dm-zone code to the atomic queue commit API Mike Snitzer
  -- strict thread matches above, loose matches on Subject: below --
2024-05-27  8:04 convert newly added dm-zone code to the atomic queue commit API v2 Christoph Hellwig
2024-05-27  8:04 ` [PATCH 1/3] dm: move setting zoned_enabled to dm_table_set_restrictions Christoph Hellwig
2024-05-27 11:34   ` Johannes Thumshirn
2024-05-27 12:36 convert newly added dm-zone code to the atomic queue commit API v3 Christoph Hellwig
2024-05-27 12:36 ` [PATCH 1/3] dm: move setting zoned_enabled to dm_table_set_restrictions Christoph Hellwig

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=ZlCtT0FadH4I8dFb@kernel.org \
    --to=snitzer@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=mpatocka@redhat.com \
    /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.