Thread (17 messages) 17 messages, 4 authors, 2021-04-19

Re: [PATCH 2/4] dm crypt: Fix zoned block device support

From: Johannes Thumshirn <hidden>
Date: 2021-04-16 07:13:26
Also in: dm-devel, linux-btrfs, linux-fsdevel, linux-nvme, linux-scsi

On 16/04/2021 05:05, Damien Le Moal wrote:

[...]
+	CRYPT_IV_NO_SECTORS,		/* IV calculation does not use sectors */
[...]
-	if (ivmode == NULL)
+	if (ivmode == NULL) {
 		cc->iv_gen_ops = NULL;
-	else if (strcmp(ivmode, "plain") == 0)
+		set_bit(CRYPT_IV_NO_SECTORS, &cc->cipher_flags);
+	} else if (strcmp(ivmode, "plain") == 0)
[...]
+		if (!test_bit(CRYPT_IV_NO_SECTORS, &cc->cipher_flags)) {
+			DMWARN("Zone append is not supported with sector-based IV cyphers");
+			ti->zone_append_not_supported = true;
+		}
I think this negation is hard to follow, at least I had a hard time
reviewing it.

Wouldn't it make more sense to use CRYPT_IV_USE_SECTORS, set the bit
for algorithms that use sectors as IV (like plain64) and then do a 
normal

	if (test_bit(CRYPT_IV_USE_SECTORS, &cc->cipher_flags)) {
		DMWARN("Zone append is not supported with sector-based IV cyphers");
		ti->zone_append_not_supported = true;
	}

i.e. without the double negation?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help