fix stacking of PI-capable devices
Hi all,
this series fixes stacking devices such as DM on top of PI-capable devices by adding support for the new pi_tuple_size field to the stacking helper. It also makes the error message when this goes wrong more readable.
Diffstat:
blk-settings.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
PATCH 1/2 block: handle pi_tuple_size in queue_limits_stack_integrity
queue_limits_stack_integrity needs to handle the new pi_tuple_size field, otherwise stacking PI-capable devices will always fail.
--- block/blk-settings.c | 3 +++ 1 file changed, 3 insertions(+)
block/blk-settings.c +3 -0
@@ -972,6 +972,8 @@ bool queue_limits_stack_integrity(struct queue_limits *t, goto incompatible;if (ti->csum_type != bi->csum_type) goto incompatible; +if (ti->pi_tuple_size != bi->pi_tuple_size) + goto incompatible;if ((ti->flags &BLK_INTEGRITY_REF_TAG ) != (bi->flags &BLK_INTEGRITY_REF_TAG )) goto incompatible;
@@ -980,6 +982,7 @@ bool queue_limits_stack_integrity(struct queue_limits *t, ti->flags |= (bi->flags &BLK_INTEGRITY_DEVICE_CAPABLE ) | (bi->flags &BLK_INTEGRITY_REF_TAG ); ti->csum_type = bi->csum_type; + ti->pi_tuple_size = bi->pi_tuple_size; ti->metadata_size = bi->metadata_size; ti->pi_offset = bi->pi_offset; ti->interval_exp = bi->interval_exp;
Signature · 1 line
2.47.2
PATCH 2/2 block: remove newlines from the warnings in blk_validate_integrity_limits
In reply to Christoph HellwigOtherwise they are very hard to read in the kernel log.
--- block/blk-settings.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
block/blk-settings.c +3 -6
@@ -157,16 +157,14 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)switch (bi->csum_type) {case BLK_INTEGRITY_CSUM_NONE :if (bi->pi_tuple_size) { -pr_warn ("pi_tuple_size must be 0 when checksum type \ -is none\n" ); +pr_warn ("pi_tuple_size must be 0 when checksum type is none\n" );return -EINVAL ; }break ;case BLK_INTEGRITY_CSUM_CRC :case BLK_INTEGRITY_CSUM_IP :if (bi->pi_tuple_size !=sizeof (struct t10_pi_tuple )) { -pr_warn ("pi_tuple_size mismatch for T10 PI: expected \ -%zu, got %u\n" , +pr_warn ("pi_tuple_size mismatch for T10 PI: expected %zu, got %u\n" ,sizeof (struct t10_pi_tuple ), bi->pi_tuple_size);return -EINVAL ;
@@ -174,8 +172,7 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)break ;case BLK_INTEGRITY_CSUM_CRC64 :if (bi->pi_tuple_size !=sizeof (struct crc64_pi_tuple )) { -pr_warn ("pi_tuple_size mismatch for CRC64 PI: \ -expected %zu, got %u\n" , +pr_warn ("pi_tuple_size mismatch for CRC64 PI: expected %zu, got %u\n" ,sizeof (struct crc64_pi_tuple ), bi->pi_tuple_size);return -EINVAL ;
Signature · 1 line
2.47.2
Martin K. Petersen
Reviewed-byChristoph,
Quoted 4 lines
this series fixes stacking devices such as DM on top of PI-capable devices by adding support for the new
pi_tuple_sizefield to the stacking helper. It also makes the error message when this goes wrong more readable.
Looks good to me.
Signature · 1 line
Martin K. Petersen
Anuj gupta
Reviewed-byQuoted 10 lines · Christoph Hellwig
this series fixes stacking devices such as DM on top of PI-capable devices by adding support for the new
pi_tuple_sizefield to the stacking helper. It also makes the error message when this goes wrong more readable.Diffstat:
blk-settings.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)[...]
Applied, thanks!
[1/2] block: handle pi_tuple_size in queue_limits_stack_integrity
commit: 61ca3b891b4b9667334c1356a73f28954c92d43a
[2/2] block: remove newlines from the warnings in blk_validate_integrity_limits
commit: f4ae1744033d54b63c31a3664a4fdf5cebec7f27Best regards,
Signature · 1 line
Jens Axboe