(Updating dm-devel address...) On Wed, Oct 25, 2023 at 02:53:17PM +0900, Damien Le Moal wrote: > On 10/25/23 14:22, Naohiro Aota wrote: > > On Tue, Oct 24, 2023 at 07:45:13AM +0900, Damien Le Moal wrote: > >> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c > >> index 37b48f63ae6a..5e4d887063d3 100644 > >> --- a/drivers/md/dm-table.c > >> +++ b/drivers/md/dm-table.c > >> @@ -1600,6 +1600,9 @@ static bool dm_table_supports_zoned_model(struct dm_table *t, > >> for (unsigned int i = 0; i < t->num_targets; i++) { > >> struct dm_target *ti = dm_table_get_target(t, i); > >> > >> + if (dm_target_is_wildcard(ti->type)) > >> + continue; > >> + > > > > This seems tricky to me. Currently, dm-error is the only dm target having > > DM_TARGET_WILDCARD. But, can we expect that will be so forever? > > Yes, I saw that. Not sure. Mike ? > > > Also, I considered what happens if the backing device is non-zoned > > one. dm_table_supports_zoned_model() returns true in that case. But, it is > > still reported as non-zoned as we copy non-zoned queue limits. So, it is > > OK ... but it is a bit tricky. > > Returning true for dm_table_supports_zoned_model() is not an issue. As the name > of the function says, this checks that the device table is OK with zoned device > but does not force the dm device to be zoned. I see. I just think it's confusing as it also checks the backing devices for other cases. > > Instead, how about implementing the .iterate_devices just like > > linear_iterate_devices? > > Because that would change how dm-error needs to be setup. Currently, there are > no arguments needed for the table entry for dm-error. If we define the > ->iterate_devices operation, we'll need a backing device and mapping start > sector. Changing the dmsetup command line for all users is probably not the best > approach... Unless I am missing something... I thought we could just return 0 when there is no backing device. But, I see, we need a start sector to call the callback function, which is pain. Then, how about continue the loop if (dm_target_supports_zoned_hm(ti->type) && !ti->type->iterate_devices) ? The target declares itself supporting zoned_hm and having NULL iterate_devices implies there is no backing device. Then, we can say that target supports the zoned model naturally.