Re: [PATCH 25/27] block: remove QUEUE_FLAG_DISCARD

Coly Li
2022-04-07T05:18:59Z

On 4/6/22 2:05 PM, Christoph Hellwig wrote:
> Just use a non-zero max_discard_sectors as an indicator for discard
> support, similar to what is done for write zeroes.
>
> The only places where needs special attention is the RAID5 driver,
> which must clear discard support for security reasons by default,
> even if the default stacking rules would allow for it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

For the bcache part,

Acked-by: Coly Li <colyli@suse.de>

Thanks.

Coly Li

> ---
> arch/um/drivers/ubd_kern.c | 2 --
> block/blk-mq-debugfs.c | 1 -
> drivers/block/drbd/drbd_nl.c | 15 ---------------
> drivers/block/loop.c | 2 --
> drivers/block/nbd.c | 3 ---
> drivers/block/null_blk/main.c | 1 -
> drivers/block/rbd.c | 1 -
> drivers/block/rnbd/rnbd-clt.c | 2 --
> drivers/block/virtio_blk.c | 2 --
> drivers/block/xen-blkfront.c | 2 --
> drivers/block/zram/zram_drv.c | 1 -
> drivers/md/bcache/super.c | 1 -
> drivers/md/dm-table.c | 5 +----
> drivers/md/dm-thin.c | 2 --
> drivers/md/dm.c | 1 -
> drivers/md/md-linear.c | 9 ---------
> drivers/md/raid0.c | 7 -------
> drivers/md/raid1.c | 14 --------------
> drivers/md/raid10.c | 14 --------------
> drivers/md/raid5.c | 12 ++++--------
> drivers/mmc/core/queue.c | 1 -
> drivers/mtd/mtd_blkdevs.c | 1 -
> drivers/nvme/host/core.c | 6 ++----
> drivers/s390/block/dasd_fba.c | 1 -
> drivers/scsi/sd.c | 2 --
> include/linux/blkdev.h | 2 --
> 26 files changed, 7 insertions(+), 103 deletions(-)
[snipped]
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 296f200b2e208..2f49e31142f62 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -973,7 +973,6 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
>
> blk_queue_flag_set(QUEUE_FLAG_NONROT, d->disk->queue);
> blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, d->disk->queue);
> - blk_queue_flag_set(QUEUE_FLAG_DISCARD, d->disk->queue);
>
> blk_queue_write_cache(q, true, true);
>

[snipped]