public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: blk_set_stacking_limits() doesn't validate
@ 2024-05-24  6:21 Hannes Reinecke
  2024-05-24  7:39 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2024-05-24  6:21 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Christoph Hellwig, Mike Snitzer, linux-block, dm-devel,
	Hannes Reinecke

blk_validate_zoned_limits() checks whether any of the zoned limits
are set for non-zoned limits. As blk_set_stacking_limits() sets
max_zone_append_sectors() it'll fail to validate.

Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 block/blk-settings.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index d2731843f2fc..524cf597b2e9 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -50,7 +50,6 @@ void blk_set_stacking_limits(struct queue_limits *lim)
 	lim->max_sectors = UINT_MAX;
 	lim->max_dev_sectors = UINT_MAX;
 	lim->max_write_zeroes_sectors = UINT_MAX;
-	lim->max_zone_append_sectors = UINT_MAX;
 	lim->max_user_discard_sectors = UINT_MAX;
 }
 EXPORT_SYMBOL(blk_set_stacking_limits);
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: blk_set_stacking_limits() doesn't validate
  2024-05-24  6:21 [PATCH] block: blk_set_stacking_limits() doesn't validate Hannes Reinecke
@ 2024-05-24  7:39 ` Christoph Hellwig
  2024-05-24  9:56   ` Hannes Reinecke
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2024-05-24  7:39 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Jens Axboe, Christoph Hellwig, Mike Snitzer, linux-block,
	dm-devel

On Fri, May 24, 2024 at 08:21:19AM +0200, Hannes Reinecke wrote:
> blk_validate_zoned_limits() checks whether any of the zoned limits
> are set for non-zoned limits. As blk_set_stacking_limits() sets
> max_zone_append_sectors() it'll fail to validate.

Except that you now broke it for zone devices.  Normally if we are
not building a stacked zoned device there should at least be one
underlying device that has a zero max_zone_append_limit, thus lowering
the stacked device limit to 0.  I guess you have a scenario where that
is not the case, so please explain it so that we can fix it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: blk_set_stacking_limits() doesn't validate
  2024-05-24  7:39 ` Christoph Hellwig
@ 2024-05-24  9:56   ` Hannes Reinecke
  2024-05-24  9:58     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2024-05-24  9:56 UTC (permalink / raw)
  To: Christoph Hellwig, Hannes Reinecke
  Cc: Jens Axboe, Mike Snitzer, linux-block, dm-devel

On 5/24/24 09:39, Christoph Hellwig wrote:
> On Fri, May 24, 2024 at 08:21:19AM +0200, Hannes Reinecke wrote:
>> blk_validate_zoned_limits() checks whether any of the zoned limits
>> are set for non-zoned limits. As blk_set_stacking_limits() sets
>> max_zone_append_sectors() it'll fail to validate.
> 
> Except that you now broke it for zone devices.  Normally if we are
> not building a stacked zoned device there should at least be one
> underlying device that has a zero max_zone_append_limit, thus lowering
> the stacked device limit to 0.  I guess you have a scenario where that
> is not the case, so please explain it so that we can fix it.
> 
I just found it weird that a simple 'memset' for the initial device 
configuration and then calling blk_set_stacking_limits() will lead to a 
failure in blk_validate_limits() ...

But I'll relent; this had been coming up during large block testing with 
NVMe, but was only tangentially related.
So I'll retract it.

Cheers,

Hannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: blk_set_stacking_limits() doesn't validate
  2024-05-24  9:56   ` Hannes Reinecke
@ 2024-05-24  9:58     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2024-05-24  9:58 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Hannes Reinecke, Jens Axboe, Mike Snitzer,
	linux-block, dm-devel

On Fri, May 24, 2024 at 11:56:17AM +0200, Hannes Reinecke wrote:
> I just found it weird that a simple 'memset' for the initial device 
> configuration and then calling blk_set_stacking_limits() will lead to a 
> failure in blk_validate_limits() ...

You don't need a memset before calling blk_set_stacking_limits as
blk_set_stacking_limits already does the memset for you.  But as
implied by the name and documented in the kerneldoc comment,
blk_set_stacking_limits is indeed intended to prepare for stacking
in other limits and is not supposed to be directly applied.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-24  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  6:21 [PATCH] block: blk_set_stacking_limits() doesn't validate Hannes Reinecke
2024-05-24  7:39 ` Christoph Hellwig
2024-05-24  9:56   ` Hannes Reinecke
2024-05-24  9:58     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox