From: Mike Snitzer <snitzer@redhat.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>,
dm-devel@redhat.com, Alasdair Kergon <agk@redhat.com>
Subject: Re: [PATCH 0/4] dm: zoned block device fixes
Date: Tue, 30 May 2017 16:20:34 -0400 [thread overview]
Message-ID: <20170530202031.GA52190@redhat.com> (raw)
In-Reply-To: <20170529102307.19814-1-damien.lemoal@wdc.com>
On Mon, May 29 2017 at 6:23P -0400,
Damien Le Moal <damien.lemoal@wdc.com> wrote:
> Mike,
>
> The first 3 patches of this series are incremental fixes for the zoned block
> device support patches that you committed to the for-4.13/dm branch.
>
> The first patch correct the zone alignement checks so that the check is
> performed for any device, regardless of the device LBA size (it is skipped for
> 512B LBA devices otherwise).
I folded this first patch into the original commit (baf844bf4ae3).
> The second patch is a fix for commit baf844bf4ae3 "dm table: add zoned block
> devices validation". In that commit, the stacked limits zoned model was not
> set to the zoned model of the table target devices, leading to the exposed
> device always being exposed as a regular block device. With this fix, dm-flaky
> and dm-linear work fine on top of host-managed zoned block devices.
>
> The third patch fixes zoned model validation again to allow for target types
> emulating a different zoned model than the model of the table target devices,
> e.g. dm-zoned.
The 2nd and 3rd seem over-done to me. After spending more time than
ideal, the following patch would seem to be the equivalent to what
you've done in patches 2 and 3 (sans the "cleanup" of passing limits to
validate_hardware_zoned_model):
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 6545150..a39bcd9 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1523,19 +1524,39 @@ int dm_calculate_queue_limits(struct dm_table *table,
dm_device_name(table->md),
(unsigned long long) ti->begin,
(unsigned long long) ti->len);
+
+ /*
+ * FIXME: this should likely be moved to blk_stack_limits(), would
+ * also eliminate limits->zoned stacking hack in dm_set_device_limits()
+ */
+ if (limits->zoned == BLK_ZONED_NONE && ti_limits.zoned != BLK_ZONED_NONE) {
+ /*
+ * By default, the stacked limits zoned model is set to
+ * BLK_ZONED_NONE in blk_set_stacking_limits(). Update
+ * this model using the first target model reported
+ * that is not BLK_ZONED_NONE. This will be either the
+ * first target device zoned model or the model reported
+ * by the target .io_hints.
+ */
+ limits->zoned = ti_limits.zoned;
+ }
}
/*
* Verify that the zoned model and zone sectors, as determined before
* any .io_hints override, are the same across all devices in the table.
- * - but if limits->zoned is not BLK_ZONED_NONE validate match for it
- * - simillarly, check all devices conform to limits->chunk_sectors if
- * .io_hints altered them
+ * - this is especially relevant if .io_hints is emulating a disk-managed
+ * zoned model (aka BLK_ZONED_NONE) on host-managed zoned block devices.
+ * BUT...
*/
- if (limits->zoned != BLK_ZONED_NONE)
+ if (limits->zoned != BLK_ZONED_NONE) {
+ /*
+ * ...IF the above limits stacking determined a zoned model
+ * validate that all of the table's devices conform to it.
+ */
zoned_model = limits->zoned;
- if (limits->chunk_sectors != zone_sectors)
zone_sectors = limits->chunk_sectors;
+ }
if (validate_hardware_zoned_model(table, zoned_model, zone_sectors))
return -EINVAL;
Anyway, I've folded this into the original commit too. If you could
verify it works with your scenarios I'd appreciate it.
FYI, any additional cosmetic cleanup can wait (I happen to think this
code is clearer than how you relied on the matches functions to
initialize a temporary value).
I also folded in an validate_hardware_zoned_model() optimization to
return early if zoned_model == BLK_ZONED_NONE, please see/test the
rolled-up end result here:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-4.13/dm&id=9a6b54360f147c2d25fba7debc31a3251b804cc2
Also, please note that I've forcibly rebased linux-dm.git's
'for-4.13/dm' and staged it in 'for-next'.
> The last patch is dm-zoned with various fixes (mainly crashes on setup error
> and handling of the metadata cache shrinker). For your review, please use this
> version.
Will do, thanks.
Mike
next prev parent reply other threads:[~2017-05-30 20:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 10:23 [PATCH 0/4] dm: zoned block device fixes Damien Le Moal
2017-05-29 10:23 ` [PATCH 1/4] dm: Fix mapping zone alignment check Damien Le Moal
2017-05-29 10:23 ` [PATCH 2/4] dm: Fix staking limits for zoned block device Damien Le Moal
2017-05-29 10:23 ` [PATCH 3/4] dm: Fix zoned block device model validation Damien Le Moal
2017-05-29 10:23 ` [PATCH 4/4] dm-zoned: Drive-managed zoned block device target Damien Le Moal
2017-05-30 20:20 ` Mike Snitzer [this message]
2017-05-31 4:29 ` [PATCH 0/4] dm: zoned block device fixes Damien Le Moal
2017-05-31 14:39 ` Mike Snitzer
2017-06-02 0:36 ` Mike Snitzer
2017-06-05 10:48 ` Damien Le Moal
2017-06-06 14:18 ` Mike Snitzer
2017-06-08 20:21 ` Mike Snitzer
2017-06-09 4:25 ` Damien Le Moal
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=20170530202031.GA52190@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=bart.vanassche@sandisk.com \
--cc=damien.lemoal@wdc.com \
--cc=dm-devel@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.