lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <20250604020850.1304633-7-yi.zhang@huaweicloud.com> Date: Wed, 4 Jun 2025 10:08:46 +0800 From: Zhang Yi <yi.zhang@...weicloud.com> To: linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org, linux-block@...r.kernel.org, dm-devel@...ts.linux.dev, linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org Cc: linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org, hch@....de, tytso@....edu, djwong@...nel.org, john.g.garry@...cle.com, bmarzins@...hat.com, chaitanyak@...dia.com, shinichiro.kawasaki@....com, brauner@...nel.org, martin.petersen@...cle.com, yi.zhang@...wei.com, yi.zhang@...weicloud.com, chengzhihao1@...wei.com, yukuai3@...wei.com, yangerkun@...wei.com Subject: [PATCH 06/10] dm: add BLK_FEAT_WRITE_ZEROES_UNMAP support From: Zhang Yi <yi.zhang@...wei.com> Set the BLK_FEAT_WRITE_ZEROES_UNMAP feature on stacking queue limits by default. This feature shall be disabled if any underlying device does not support it. Signed-off-by: Zhang Yi <yi.zhang@...wei.com> Reviewed-by: Benjamin Marzinski <bmarzins@...hat.com> --- drivers/md/dm-table.c | 7 +++++-- drivers/md/dm.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 6b23e777e10e..4d450713b69d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -599,7 +599,8 @@ int dm_split_args(int *argc, char ***argvp, char *input) static void dm_set_stacking_limits(struct queue_limits *limits) { blk_set_stacking_limits(limits); - limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL; + limits->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL | + BLK_FEAT_WRITE_ZEROES_UNMAP; } /* @@ -1851,8 +1852,10 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, limits->discard_alignment = 0; } - if (!dm_table_supports_write_zeroes(t)) + if (!dm_table_supports_write_zeroes(t)) { limits->max_write_zeroes_sectors = 0; + limits->features &= ~BLK_FEAT_WRITE_ZEROES_UNMAP; + } if (!dm_table_supports_secure_erase(t)) limits->max_secure_erase_sectors = 0; diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5ab7574c0c76..b59c3dbeaaf1 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1096,6 +1096,7 @@ void disable_write_zeroes(struct mapped_device *md) /* device doesn't really support WRITE ZEROES, disable it */ limits->max_write_zeroes_sectors = 0; + limits->features &= ~BLK_FEAT_WRITE_ZEROES_UNMAP; } static bool swap_bios_limit(struct dm_target *ti, struct bio *bio) -- 2.46.1
Powered by blists - more mailing lists