linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix dm-crypt zoned block device support
@ 2021-04-16  3:05 Damien Le Moal
  2021-04-16  3:05 ` [PATCH 1/4] dm: Introduce zone append support control Damien Le Moal
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  3:05 UTC (permalink / raw)
  To: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

Mike,

Zone append BIOs (REQ_OP_ZONE_APPEND) always specify the start sector
of the zone to be written instead of the actual location sector to
write. The write location is determined by the device and returned to
the host upon completion of the operation.

This interface, while simple and efficient for writing into sequential
zones of a zoned block device, is incompatible with the use of sector
values to calculate a cypher block IV. All data written in a zone is
encrypted using an IV calculated from the first sectors of the zone,
but read operation will specify any sector within the zone, resulting
in an IV mismatch between encryption and decryption. Reads fail in that
case.

Using a single sector value (e.g. the zone start sector) for all read
and writes into a zone can solve this problem, but at the cost of
weakening the cypher chosen by the user. Emulating zone append using
regular writes would be another potential solution, but it is complex
and would add a lot of overhead.

Instead, to solve this problem, explicitly disable support for zone
append operations in dm-crypt if the target was setup using a cypher IV
mode using sector values. The null and random IV modes can still be used
with zone append operations. This lack of support for zone append is
exposed to the user by setting the dm-crypt target queue limit
max_zone_append_sectors to 0. This change is done in patch 1 and 2.

Patch 3 addresses btrfs-zoned case. Zone append write are used for all
file data blocks write. The change introduced fails mounting a zoned
btrfs volume if the underlying device max_zone_append_sectors limit is
0.

Patch 4 fixes zonefs to fall back to using regular write when
max_zone_append_sectors is 0.

Overall, these changes do not break user space:
1) There is no interface allowing a user to use zone append write
without a file system. So applications using directly a raw dm-crypt
device will continue working using regular write operations.
2) btrfs zoned support was added in 5.12. Anybody trying btrfs-zoned on
top of dm-crypt would have faced the read failures already. So there
are no existing deployments to preserve. Same for zonefs.

For file systems, using zone append with encryption will need to be
supported within the file system (e.g. fscrypt). In this case, cypher IV
calculation can rely for instance on file block offsets as these are
known before a zone append operation write these blocks to disk at
unknown locations.

Reviews and comments are very much welcome.

Damien Le Moal (3):
  dm: Introduce zone append support control
  dm crypt: Fix zoned block device support
  zonefs: fix synchronous write to sequential zone files

Johannes Thumshirn (1):
  btrfs: zoned: fail mount if the device does not support zone append

 drivers/md/dm-crypt.c         | 48 ++++++++++++++++++++++++++++-------
 drivers/md/dm-table.c         | 41 ++++++++++++++++++++++++++++++
 fs/btrfs/zoned.c              |  7 +++++
 fs/zonefs/super.c             | 16 +++++++++---
 fs/zonefs/zonefs.h            |  2 ++
 include/linux/device-mapper.h |  6 +++++
 6 files changed, 107 insertions(+), 13 deletions(-)

-- 
2.30.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH 1/4] dm: Introduce zone append support control
  2021-04-16  3:05 [PATCH 0/4] Fix dm-crypt zoned block device support Damien Le Moal
@ 2021-04-16  3:05 ` Damien Le Moal
  2021-04-16  6:51   ` Johannes Thumshirn
  2021-04-16  3:05 ` [PATCH 2/4] dm crypt: Fix zoned block device support Damien Le Moal
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  3:05 UTC (permalink / raw)
  To: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

Add the boolean field zone_append_not_supported to the dm_target
structure to allow a target implementing a zoned block device to
explicitly opt out from zone append (REQ_OP_ZONE_APPEND) operations
support. When set to true by the target constructor, the target device
queue limit max_zone_append_sectors is set to 0 in
dm_table_set_restrictions() so that users of the target (e.g. file
systems) can detect that the device cannot process zone append
operations.

Detection for the target support of zone append is done similarly to
the detection for other device features such as secure erase, using a
helper function. For zone append, the function
dm_table_supports_zone_append() is defined if CONFIG_BLK_DEV_ZONED is
enabled.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/md/dm-table.c         | 41 +++++++++++++++++++++++++++++++++++
 include/linux/device-mapper.h |  6 +++++
 2 files changed, 47 insertions(+)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e5f0f1703c5d..9efd7a0ee27e 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1999,6 +1999,37 @@ static int device_requires_stable_pages(struct dm_target *ti,
 	return blk_queue_stable_writes(q);
 }
 
+#ifdef CONFIG_BLK_DEV_ZONED
+static int device_not_zone_append_capable(struct dm_target *ti,
+					  struct dm_dev *dev, sector_t start,
+					  sector_t len, void *data)
+{
+	struct request_queue *q = bdev_get_queue(dev->bdev);
+
+	return !blk_queue_is_zoned(q) ||
+		!q->limits.max_zone_append_sectors;
+}
+
+static bool dm_table_supports_zone_append(struct dm_table *t)
+{
+	struct dm_target *ti;
+	unsigned int i;
+
+	for (i = 0; i < dm_table_get_num_targets(t); i++) {
+		ti = dm_table_get_target(t, i);
+
+		if (ti->zone_append_not_supported)
+			return false;
+
+		if (!ti->type->iterate_devices ||
+		    ti->type->iterate_devices(ti, device_not_zone_append_capable, NULL))
+			return false;
+	}
+
+	return true;
+}
+#endif
+
 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
 			       struct queue_limits *limits)
 {
@@ -2091,6 +2122,16 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
 	if (blk_queue_is_zoned(q)) {
 		WARN_ON_ONCE(queue_is_mq(q));
 		q->nr_zones = blkdev_nr_zones(t->md->disk);
+
+		/*
+		 * All zoned devices support zone append by default. However,
+		 * some zoned targets (e.g. dm-crypt) cannot support this
+		 * operation. Check here if the target indicated the lack of
+		 * support for zone append and set max_zone_append_sectors to 0
+		 * in that case so that users (e.g. an FS) can detect this fact.
+		 */
+		if (!dm_table_supports_zone_append(t))
+			q->limits.max_zone_append_sectors = 0;
 	}
 #endif
 
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 5c641f930caf..4da699add262 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -361,6 +361,12 @@ struct dm_target {
 	 * Set if we need to limit the number of in-flight bios when swapping.
 	 */
 	bool limit_swap_bios:1;
+
+	/*
+	 * Set if this target is a zoned device that cannot accept
+	 * zone append operations.
+	 */
+	bool zone_append_not_supported:1;
 };
 
 void *dm_per_bio_data(struct bio *bio, size_t data_size);
-- 
2.30.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH 2/4] dm crypt: Fix zoned block device support
  2021-04-16  3:05 [PATCH 0/4] Fix dm-crypt zoned block device support Damien Le Moal
  2021-04-16  3:05 ` [PATCH 1/4] dm: Introduce zone append support control Damien Le Moal
@ 2021-04-16  3:05 ` Damien Le Moal
  2021-04-16  7:13   ` Johannes Thumshirn
  2021-04-16  3:05 ` [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append Damien Le Moal
  2021-04-16  3:05 ` [PATCH 4/4] zonefs: fix synchronous write to sequential zone files Damien Le Moal
  3 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  3:05 UTC (permalink / raw)
  To: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

Zone append BIOs (REQ_OP_ZONE_APPEND) always specify the start sector of
the zone to be written instead of the actual location sector to write.
The write location is determined by the device and returned to the host
upon completion of the operation. This interface, while simple and
efficient for writing into sequential zones of a zoned block device, is
incompatible with the use of sector values to calculate a cypher block
IV. All data written in a zone end up using the same IV values
corresponding to the first sectors of the zone, but read operation will
specify any sector within the zone, resulting in an IV mismatch between
encryption and decryption.

Using a single sector value (e.g. the zone start sector) for all read
and writes into a zone can solve this problem, but at the cost of
weakening the cypher chosen by the user. Instead, to solve this
problem, explicitly disable support for zone append operations using
the zone_append_not_supported field of struct dm_target if the IV mode
used is sector-based, that is for all IVs modes except null and random.

The cypher flag CRYPT_IV_NO_SECTORS iis introduced to indicate that the
cypher does not use sector values. This flag is set in
crypt_ctr_ivmode() for the null and random IV modes and checked in
crypt_ctr() to set to true zone_append_not_supported if
CRYPT_IV_NO_SECTORS is not set for the chosen cypher.

Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/md/dm-crypt.c | 48 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index b0ab080f2567..0a44bc0ff960 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -137,6 +137,7 @@ enum cipher_flags {
 	CRYPT_MODE_INTEGRITY_AEAD,	/* Use authenticated mode for cipher */
 	CRYPT_IV_LARGE_SECTORS,		/* Calculate IV from sector_size, not 512B sectors */
 	CRYPT_ENCRYPT_PREPROCESS,	/* Must preprocess data for encryption (elephant) */
+	CRYPT_IV_NO_SECTORS,		/* IV calculation does not use sectors */
 };
 
 /*
@@ -2750,9 +2751,10 @@ static int crypt_ctr_ivmode(struct dm_target *ti, const char *ivmode)
 	}
 
 	/* Choose ivmode, see comments at iv code. */
-	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)
 		cc->iv_gen_ops = &crypt_iv_plain_ops;
 	else if (strcmp(ivmode, "plain64") == 0)
 		cc->iv_gen_ops = &crypt_iv_plain64_ops;
@@ -2762,9 +2764,10 @@ static int crypt_ctr_ivmode(struct dm_target *ti, const char *ivmode)
 		cc->iv_gen_ops = &crypt_iv_essiv_ops;
 	else if (strcmp(ivmode, "benbi") == 0)
 		cc->iv_gen_ops = &crypt_iv_benbi_ops;
-	else if (strcmp(ivmode, "null") == 0)
+	else if (strcmp(ivmode, "null") == 0) {
 		cc->iv_gen_ops = &crypt_iv_null_ops;
-	else if (strcmp(ivmode, "eboiv") == 0)
+		set_bit(CRYPT_IV_NO_SECTORS, &cc->cipher_flags);
+	} else if (strcmp(ivmode, "eboiv") == 0)
 		cc->iv_gen_ops = &crypt_iv_eboiv_ops;
 	else if (strcmp(ivmode, "elephant") == 0) {
 		cc->iv_gen_ops = &crypt_iv_elephant_ops;
@@ -2791,6 +2794,7 @@ static int crypt_ctr_ivmode(struct dm_target *ti, const char *ivmode)
 		cc->key_extra_size = cc->iv_size + TCW_WHITENING_SIZE;
 	} else if (strcmp(ivmode, "random") == 0) {
 		cc->iv_gen_ops = &crypt_iv_random_ops;
+		set_bit(CRYPT_IV_NO_SECTORS, &cc->cipher_flags);
 		/* Need storage space in integrity fields. */
 		cc->integrity_iv_size = cc->iv_size;
 	} else {
@@ -3281,14 +3285,31 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	}
 	cc->start = tmpll;
 
-	/*
-	 * For zoned block devices, we need to preserve the issuer write
-	 * ordering. To do so, disable write workqueues and force inline
-	 * encryption completion.
-	 */
 	if (bdev_is_zoned(cc->dev->bdev)) {
+		/*
+		 * For zoned block devices, we need to preserve the issuer write
+		 * ordering. To do so, disable write workqueues and force inline
+		 * encryption completion.
+		 */
 		set_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags);
 		set_bit(DM_CRYPT_WRITE_INLINE, &cc->flags);
+
+		/*
+		 * All zone append writes to a zone of a zoned block device will
+		 * have the same BIO sector (the start of the zone). When the
+		 * cypher IV mode uses sector values, all data targeting a
+		 * zone will be encrypted using the first sector numbers of the
+		 * zone. This will not result in write errors but will
+		 * cause most reads to fail as reads will use the sector values
+		 * for the actual data location, resulting in IV mismatch.
+		 * To avoid this problem, allow zone append operations only for
+		 * cyphers with an IV mode not using sector values (null and
+		 * random IVs).
+		 */
+		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;
+		}
 	}
 
 	if (crypt_integrity_aead(cc) || cc->integrity_iv_size) {
@@ -3356,6 +3377,15 @@ static int crypt_map(struct dm_target *ti, struct bio *bio)
 	struct dm_crypt_io *io;
 	struct crypt_config *cc = ti->private;
 
+	/*
+	 * For zoned targets using a sector based IV, zone append is not
+	 * supported. We should not see any such operation in that case.
+	 * In the unlikely case we do, warn and fail the request.
+	 */
+	if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND &&
+			 !test_bit(CRYPT_IV_NO_SECTORS, &cc->cipher_flags)))
+		return DM_MAPIO_KILL;
+
 	/*
 	 * If bio is REQ_PREFLUSH or REQ_OP_DISCARD, just bypass crypt queues.
 	 * - for REQ_PREFLUSH device-mapper core ensures that no IO is in-flight
-- 
2.30.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-16  3:05 [PATCH 0/4] Fix dm-crypt zoned block device support Damien Le Moal
  2021-04-16  3:05 ` [PATCH 1/4] dm: Introduce zone append support control Damien Le Moal
  2021-04-16  3:05 ` [PATCH 2/4] dm crypt: Fix zoned block device support Damien Le Moal
@ 2021-04-16  3:05 ` Damien Le Moal
  2021-04-16 16:17   ` David Sterba
  2021-04-16  3:05 ` [PATCH 4/4] zonefs: fix synchronous write to sequential zone files Damien Le Moal
  3 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  3:05 UTC (permalink / raw)
  To: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

For zoned btrfs, zone append is mandatory to write to a sequential write
only zone, otherwise parallel writes to the same zone could result in
unaligned write errors.

If a zoned block device does not support zone append (e.g. a dm-crypt
zoned device using a non-NULL IV cypher), fail to mount.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 fs/btrfs/zoned.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index eeb3ebe11d7a..70b23a0d03b1 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -342,6 +342,13 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device)
 	if (!IS_ALIGNED(nr_sectors, zone_sectors))
 		zone_info->nr_zones++;
 
+	if (bdev_is_zoned(bdev) && zone_info->max_zone_append_size == 0) {
+		btrfs_err(fs_info, "zoned: device %pg does not support zone append",
+			  bdev);
+		ret = -EINVAL;
+		goto out;
+	}
+
 	zone_info->seq_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
 	if (!zone_info->seq_zones) {
 		ret = -ENOMEM;
-- 
2.30.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* [PATCH 4/4] zonefs: fix synchronous write to sequential zone files
  2021-04-16  3:05 [PATCH 0/4] Fix dm-crypt zoned block device support Damien Le Moal
                   ` (2 preceding siblings ...)
  2021-04-16  3:05 ` [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append Damien Le Moal
@ 2021-04-16  3:05 ` Damien Le Moal
  2021-04-16  6:50   ` Johannes Thumshirn
  3 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  3:05 UTC (permalink / raw)
  To: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

Synchronous writes to sequential zone files cannot use zone append
operations if the underlying zoned device queue limit
max_zone_append_sectors is 0, indicating that the device does not
support this operation. In this case, fall back to using regular write
operations.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 fs/zonefs/super.c  | 16 ++++++++++++----
 fs/zonefs/zonefs.h |  2 ++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 049e36c69ed7..b97566b9dff7 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -689,14 +689,15 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
 {
 	struct inode *inode = file_inode(iocb->ki_filp);
 	struct zonefs_inode_info *zi = ZONEFS_I(inode);
-	struct block_device *bdev = inode->i_sb->s_bdev;
-	unsigned int max;
+	struct super_block *sb = inode->i_sb;
+	struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
+	struct block_device *bdev = sb->s_bdev;
+	sector_t max = sbi->s_max_zone_append_sectors;
 	struct bio *bio;
 	ssize_t size;
 	int nr_pages;
 	ssize_t ret;
 
-	max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
 	max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
 	iov_iter_truncate(from, max);
 
@@ -853,6 +854,8 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from)
 
 	/* Enforce sequential writes (append only) in sequential zones */
 	if (zi->i_ztype == ZONEFS_ZTYPE_SEQ) {
+		struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
+
 		mutex_lock(&zi->i_truncate_mutex);
 		if (iocb->ki_pos != zi->i_wpoffset) {
 			mutex_unlock(&zi->i_truncate_mutex);
@@ -860,7 +863,7 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from)
 			goto inode_unlock;
 		}
 		mutex_unlock(&zi->i_truncate_mutex);
-		append = sync;
+		append = sync && sbi->s_max_zone_append_sectors;
 	}
 
 	if (append)
@@ -1683,6 +1686,11 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent)
 		sbi->s_mount_opts &= ~ZONEFS_MNTOPT_EXPLICIT_OPEN;
 	}
 
+	sbi->s_max_zone_append_sectors =
+		queue_max_zone_append_sectors(bdev_get_queue(sb->s_bdev));
+	if (!sbi->s_max_zone_append_sectors)
+		zonefs_info(sb, "Zone append is not supported: falling back to using regular writes\n");
+
 	ret = zonefs_read_super(sb);
 	if (ret)
 		return ret;
diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h
index 51141907097c..2b8c3b1a32ea 100644
--- a/fs/zonefs/zonefs.h
+++ b/fs/zonefs/zonefs.h
@@ -185,6 +185,8 @@ struct zonefs_sb_info {
 
 	unsigned int		s_max_open_zones;
 	atomic_t		s_open_zones;
+
+	sector_t		s_max_zone_append_sectors;
 };
 
 static inline struct zonefs_sb_info *ZONEFS_SB(struct super_block *sb)
-- 
2.30.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 4/4] zonefs: fix synchronous write to sequential zone files
  2021-04-16  3:05 ` [PATCH 4/4] zonefs: fix synchronous write to sequential zone files Damien Le Moal
@ 2021-04-16  6:50   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2021-04-16  6:50 UTC (permalink / raw)
  To: Damien Le Moal, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Shinichiro Kawasaki, Naohiro Aota

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 1/4] dm: Introduce zone append support control
  2021-04-16  3:05 ` [PATCH 1/4] dm: Introduce zone append support control Damien Le Moal
@ 2021-04-16  6:51   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2021-04-16  6:51 UTC (permalink / raw)
  To: Damien Le Moal, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Shinichiro Kawasaki, Naohiro Aota

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 2/4] dm crypt: Fix zoned block device support
  2021-04-16  3:05 ` [PATCH 2/4] dm crypt: Fix zoned block device support Damien Le Moal
@ 2021-04-16  7:13   ` Johannes Thumshirn
  2021-04-16  7:30     ` Damien Le Moal
  0 siblings, 1 reply; 17+ messages in thread
From: Johannes Thumshirn @ 2021-04-16  7:13 UTC (permalink / raw)
  To: Damien Le Moal, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Shinichiro Kawasaki, Naohiro Aota

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?


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 2/4] dm crypt: Fix zoned block device support
  2021-04-16  7:13   ` Johannes Thumshirn
@ 2021-04-16  7:30     ` Damien Le Moal
  2021-04-16  9:10       ` Johannes Thumshirn
  0 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-16  7:30 UTC (permalink / raw)
  To: Johannes Thumshirn, dm-devel, Mike Snitzer, linux-block,
	Jens Axboe, linux-nvme, Christoph Hellwig, linux-scsi,
	Martin K . Petersen, linux-fsdevel, linux-btrfs, David Sterba,
	Josef Bacik
  Cc: Shinichiro Kawasaki, Naohiro Aota

On 2021/04/16 16:13, Johannes Thumshirn wrote:
> 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

There are only 2 IV modes that do not use sectors. null and random. All others
do. Hence the "NO_SECTORS" choice. That is the exception rather than the norm,
the flag indicates that.

> 
> 	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?

Yes. I agree, it is more readable. But adds more lines for the same result. I
could add a small boolean helper to make the "!test_bit(CRYPT_IV_NO_SECTORS,
&cc->cipher_flags)" easier to understand.


> 
> 


-- 
Damien Le Moal
Western Digital Research

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 2/4] dm crypt: Fix zoned block device support
  2021-04-16  7:30     ` Damien Le Moal
@ 2021-04-16  9:10       ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2021-04-16  9:10 UTC (permalink / raw)
  To: Damien Le Moal, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik
  Cc: Shinichiro Kawasaki, Naohiro Aota

On 16/04/2021 09:30, Damien Le Moal wrote:
> On 2021/04/16 16:13, Johannes Thumshirn wrote:
>> 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
> 
> There are only 2 IV modes that do not use sectors. null and random. All others
> do. Hence the "NO_SECTORS" choice. That is the exception rather than the norm,
> the flag indicates that.
> 
>>
>> 	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?
> 
> Yes. I agree, it is more readable. But adds more lines for the same result. I
> could add a small boolean helper to make the "!test_bit(CRYPT_IV_NO_SECTORS,
> &cc->cipher_flags)" easier to understand.
> 

Yes I guessed this was the reason for the choice.
Maybe 

set_bit(CRYPT_IV_USE_SECTORS, &cc->cipher_flags);

if (!strcmp(ivmode, "plain") || !strcmp(ivmode, "random"))
	clear_bit(CRYPT_IV_USE_SECTORS, &cc->cipher_flags);

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;
}


Ultimately it's your and Mikes's call, but I /think/ this makes the code easier
to understand.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-16  3:05 ` [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append Damien Le Moal
@ 2021-04-16 16:17   ` David Sterba
  2021-04-19  9:28     ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: David Sterba @ 2021-04-16 16:17 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: dm-devel, Mike Snitzer, linux-block, Jens Axboe, linux-nvme,
	Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik,
	Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

On Fri, Apr 16, 2021 at 12:05:27PM +0900, Damien Le Moal wrote:
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> For zoned btrfs, zone append is mandatory to write to a sequential write
> only zone, otherwise parallel writes to the same zone could result in
> unaligned write errors.
> 
> If a zoned block device does not support zone append (e.g. a dm-crypt
> zoned device using a non-NULL IV cypher), fail to mount.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Added to misc-next, thanks. I'll queue it for 5.13, it's not an urgent
fix for 5.12 release but i'll tag it as stable so it'll apear in 5.12.x
later.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-16 16:17   ` David Sterba
@ 2021-04-19  9:28     ` Christoph Hellwig
  2021-04-19  9:35       ` Damien Le Moal
  2021-04-19  9:39       ` Johannes Thumshirn
  0 siblings, 2 replies; 17+ messages in thread
From: Christoph Hellwig @ 2021-04-19  9:28 UTC (permalink / raw)
  To: dsterba, Damien Le Moal, dm-devel, Mike Snitzer, linux-block,
	Jens Axboe, linux-nvme, Christoph Hellwig, linux-scsi,
	Martin K . Petersen, linux-fsdevel, linux-btrfs, David Sterba,
	Josef Bacik, Johannes Thumshirn, Shinichiro Kawasaki,
	Naohiro Aota

On Fri, Apr 16, 2021 at 06:17:21PM +0200, David Sterba wrote:
> On Fri, Apr 16, 2021 at 12:05:27PM +0900, Damien Le Moal wrote:
> > From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > 
> > For zoned btrfs, zone append is mandatory to write to a sequential write
> > only zone, otherwise parallel writes to the same zone could result in
> > unaligned write errors.
> > 
> > If a zoned block device does not support zone append (e.g. a dm-crypt
> > zoned device using a non-NULL IV cypher), fail to mount.
> > 
> > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> 
> Added to misc-next, thanks. I'll queue it for 5.13, it's not an urgent
> fix for 5.12 release but i'll tag it as stable so it'll apear in 5.12.x
> later.

Please don't.  Zone append is a strict requirement for zoned devices,
no need to add cargo cult code like this everywhere.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-19  9:28     ` Christoph Hellwig
@ 2021-04-19  9:35       ` Damien Le Moal
  2021-04-19  9:39         ` hch
  2021-04-19  9:39       ` Johannes Thumshirn
  1 sibling, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-19  9:35 UTC (permalink / raw)
  To: hch, dsterba, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik,
	Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

On 2021/04/19 18:29, Christoph Hellwig wrote:
> On Fri, Apr 16, 2021 at 06:17:21PM +0200, David Sterba wrote:
>> On Fri, Apr 16, 2021 at 12:05:27PM +0900, Damien Le Moal wrote:
>>> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>>
>>> For zoned btrfs, zone append is mandatory to write to a sequential write
>>> only zone, otherwise parallel writes to the same zone could result in
>>> unaligned write errors.
>>>
>>> If a zoned block device does not support zone append (e.g. a dm-crypt
>>> zoned device using a non-NULL IV cypher), fail to mount.
>>>
>>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>>
>> Added to misc-next, thanks. I'll queue it for 5.13, it's not an urgent
>> fix for 5.12 release but i'll tag it as stable so it'll apear in 5.12.x
>> later.
> 
> Please don't.  Zone append is a strict requirement for zoned devices,
> no need to add cargo cult code like this everywhere.

This is only to avoid someone from running zoned-btrfs on top of dm-crypt.
Without this patch, mount will be OK and file data writes will also actually be
OK. But all reads will miserably fail... I would rather have this patch in than
deal with the "bug reports" about btrfs failing to read files. No ?

Note that like you, I dislike having to add such code. But it was my oversight
when I worked on getting dm-crypt to work on zoned drives. Zone append was
overlooked at that time... My bad, really.


-- 
Damien Le Moal
Western Digital Research

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-19  9:35       ` Damien Le Moal
@ 2021-04-19  9:39         ` hch
  2021-04-19  9:46           ` Damien Le Moal
  0 siblings, 1 reply; 17+ messages in thread
From: hch @ 2021-04-19  9:39 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: hch, dsterba, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik,
	Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

On Mon, Apr 19, 2021 at 09:35:37AM +0000, Damien Le Moal wrote:
> This is only to avoid someone from running zoned-btrfs on top of dm-crypt.
> Without this patch, mount will be OK and file data writes will also actually be
> OK. But all reads will miserably fail... I would rather have this patch in than
> deal with the "bug reports" about btrfs failing to read files. No ?
> 
> Note that like you, I dislike having to add such code. But it was my oversight
> when I worked on getting dm-crypt to work on zoned drives. Zone append was
> overlooked at that time... My bad, really.

dm-crypt needs to stop pretending it supports zoned devices if it
doesn't.  Note that dm-crypt could fairly trivially support zone append
by doing the same kind of emulation that the sd driver does.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-19  9:28     ` Christoph Hellwig
  2021-04-19  9:35       ` Damien Le Moal
@ 2021-04-19  9:39       ` Johannes Thumshirn
  1 sibling, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2021-04-19  9:39 UTC (permalink / raw)
  To: hch, dsterba, Damien Le Moal, dm-devel, Mike Snitzer,
	linux-block, Jens Axboe, linux-nvme, Christoph Hellwig,
	linux-scsi, Martin K . Petersen, linux-fsdevel, linux-btrfs,
	David Sterba, Josef Bacik, Shinichiro Kawasaki, Naohiro Aota

On 19/04/2021 11:29, Christoph Hellwig wrote:
> On Fri, Apr 16, 2021 at 06:17:21PM +0200, David Sterba wrote:
>> On Fri, Apr 16, 2021 at 12:05:27PM +0900, Damien Le Moal wrote:
>>> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>>
>>> For zoned btrfs, zone append is mandatory to write to a sequential write
>>> only zone, otherwise parallel writes to the same zone could result in
>>> unaligned write errors.
>>>
>>> If a zoned block device does not support zone append (e.g. a dm-crypt
>>> zoned device using a non-NULL IV cypher), fail to mount.
>>>
>>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>>
>> Added to misc-next, thanks. I'll queue it for 5.13, it's not an urgent
>> fix for 5.12 release but i'll tag it as stable so it'll apear in 5.12.x
>> later.
> 
> Please don't.  Zone append is a strict requirement for zoned devices,
> no need to add cargo cult code like this everywhere.
> 

As of now, dm-crypt supports zoned devices but cannot really work with 
zone append. At least not with ciphers that use sectors as IV.
OTOH btrfs cannot work without zone append. While we won't notice any 
problems with writes, reads (or better decrypt) will fail.


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-19  9:39         ` hch
@ 2021-04-19  9:46           ` Damien Le Moal
  2021-04-19 16:48             ` David Sterba
  0 siblings, 1 reply; 17+ messages in thread
From: Damien Le Moal @ 2021-04-19  9:46 UTC (permalink / raw)
  To: hch
  Cc: dsterba, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik,
	Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

On 2021/04/19 18:41, hch@infradead.org wrote:
> On Mon, Apr 19, 2021 at 09:35:37AM +0000, Damien Le Moal wrote:
>> This is only to avoid someone from running zoned-btrfs on top of dm-crypt.
>> Without this patch, mount will be OK and file data writes will also actually be
>> OK. But all reads will miserably fail... I would rather have this patch in than
>> deal with the "bug reports" about btrfs failing to read files. No ?
>>
>> Note that like you, I dislike having to add such code. But it was my oversight
>> when I worked on getting dm-crypt to work on zoned drives. Zone append was
>> overlooked at that time... My bad, really.
> 
> dm-crypt needs to stop pretending it supports zoned devices if it
> doesn't.  Note that dm-crypt could fairly trivially support zone append
> by doing the same kind of emulation that the sd driver does.

I am not so sure about the "trivial" but yes, it is feasible. Let me think about
something then. Whatever we do, performance with ZNS will no be great, for
sure... But for SMR HDDs, we likely will not notice any difference in performance.


-- 
Damien Le Moal
Western Digital Research

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Re: [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append
  2021-04-19  9:46           ` Damien Le Moal
@ 2021-04-19 16:48             ` David Sterba
  0 siblings, 0 replies; 17+ messages in thread
From: David Sterba @ 2021-04-19 16:48 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: hch, dsterba, dm-devel, Mike Snitzer, linux-block, Jens Axboe,
	linux-nvme, Christoph Hellwig, linux-scsi, Martin K . Petersen,
	linux-fsdevel, linux-btrfs, David Sterba, Josef Bacik,
	Johannes Thumshirn, Shinichiro Kawasaki, Naohiro Aota

On Mon, Apr 19, 2021 at 09:46:36AM +0000, Damien Le Moal wrote:
> On 2021/04/19 18:41, hch@infradead.org wrote:
> > On Mon, Apr 19, 2021 at 09:35:37AM +0000, Damien Le Moal wrote:
> >> This is only to avoid someone from running zoned-btrfs on top of dm-crypt.
> >> Without this patch, mount will be OK and file data writes will also actually be
> >> OK. But all reads will miserably fail... I would rather have this patch in than
> >> deal with the "bug reports" about btrfs failing to read files. No ?
> >>
> >> Note that like you, I dislike having to add such code. But it was my oversight
> >> when I worked on getting dm-crypt to work on zoned drives. Zone append was
> >> overlooked at that time... My bad, really.
> > 
> > dm-crypt needs to stop pretending it supports zoned devices if it
> > doesn't.  Note that dm-crypt could fairly trivially support zone append
> > by doing the same kind of emulation that the sd driver does.
> 
> I am not so sure about the "trivial" but yes, it is feasible. Let me think about
> something then. Whatever we do, performance with ZNS will no be great, for
> sure... But for SMR HDDs, we likely will not notice any difference in performance.

So this needs to be fixed outside of btrfs. The fix in btrfs would make
sense in case we can't sync the dm-crypt and btrfs in a released kernel.
Having a mount check sounds like a better option to me than to fail
reads, we can revert it in a release once everything woks as expected.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-04-19 16:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16  3:05 [PATCH 0/4] Fix dm-crypt zoned block device support Damien Le Moal
2021-04-16  3:05 ` [PATCH 1/4] dm: Introduce zone append support control Damien Le Moal
2021-04-16  6:51   ` Johannes Thumshirn
2021-04-16  3:05 ` [PATCH 2/4] dm crypt: Fix zoned block device support Damien Le Moal
2021-04-16  7:13   ` Johannes Thumshirn
2021-04-16  7:30     ` Damien Le Moal
2021-04-16  9:10       ` Johannes Thumshirn
2021-04-16  3:05 ` [PATCH 3/4] btrfs: zoned: fail mount if the device does not support zone append Damien Le Moal
2021-04-16 16:17   ` David Sterba
2021-04-19  9:28     ` Christoph Hellwig
2021-04-19  9:35       ` Damien Le Moal
2021-04-19  9:39         ` hch
2021-04-19  9:46           ` Damien Le Moal
2021-04-19 16:48             ` David Sterba
2021-04-19  9:39       ` Johannes Thumshirn
2021-04-16  3:05 ` [PATCH 4/4] zonefs: fix synchronous write to sequential zone files Damien Le Moal
2021-04-16  6:50   ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).