WSL2-Linux-Kernel/block
Shin'ichiro Kawasaki e511350590 block: Discard page cache of zone reset target range
When zone reset ioctl and data read race for a same zone on zoned block
devices, the data read leaves stale page cache even though the zone
reset ioctl zero clears all the zone data on the device. To avoid
non-zero data read from the stale page cache after zone reset, discard
page cache of reset target zones in blkdev_zone_mgmt_ioctl(). Introduce
the helper function blkdev_truncate_zone_range() to discard the page
cache. Ensure the page cache discarded by calling the helper function
before and after zone reset in same manner as fallocate does.

This patch can be applied back to the stable kernel version v5.10.y.
Rework is needed for older stable kernels.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 3ed05a987e ("blk-zoned: implement ioctls")
Cc: <stable@vger.kernel.org> # 5.10+
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210311072546.678999-1-shinichiro.kawasaki@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-03-11 11:49:25 -07:00
..
partitions block: revert "block: fix bd_size_lock use" 2021-02-28 20:12:02 -07:00
Kconfig
Kconfig.iosched
Makefile
badblocks.c
bfq-cgroup.c
bfq-iosched.c block/bfq: update comments and default value in docs for fifo_expire 2021-03-02 11:25:38 -07:00
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c
bio.c block: rename BIO_MAX_PAGES to BIO_MAX_VECS 2021-03-11 07:47:48 -07:00
blk-cgroup-rwstat.c blk-cgroup: Fix the recursive blkg rwstat 2021-03-05 11:32:15 -07:00
blk-cgroup-rwstat.h
blk-cgroup.c for-5.12/block-2021-02-17 2021-02-21 11:02:48 -08:00
blk-core.c block: get rid of the trace rq insert wrapper 2021-02-22 06:37:41 -07:00
blk-crypto-fallback.c block: rename BIO_MAX_PAGES to BIO_MAX_VECS 2021-03-11 07:47:48 -07:00
blk-crypto-internal.h
blk-crypto.c dm: support key eviction from keyslot managers of underlying devices 2021-02-11 09:45:25 -05:00
blk-exec.c
blk-flush.c
blk-integrity.c
blk-ioc.c
blk-iocost.c
blk-iolatency.c
blk-lib.c block: rename BIO_MAX_PAGES to BIO_MAX_VECS 2021-03-11 07:47:48 -07:00
blk-map.c block: rename BIO_MAX_PAGES to BIO_MAX_VECS 2021-03-11 07:47:48 -07:00
blk-merge.c
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c block: Drop leftover references to RQF_SORTED 2021-03-01 10:15:07 -07:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c block: Drop leftover references to RQF_SORTED 2021-03-01 10:15:07 -07:00
blk-mq-sched.h block: get rid of the trace rq insert wrapper 2021-02-22 06:37:41 -07:00
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c for-5.12/block-ipi-2021-02-21 2021-02-22 10:53:05 -08:00
blk-mq.h
blk-pm.c
blk-pm.h block: Remove unused blk_pm_*() function definitions 2021-02-22 06:33:48 -07:00
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c blk-settings: align max_sectors on "logical_block_size" boundary 2021-02-23 19:25:36 -07:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: fix potential IO hang when turning off io_poll 2021-02-22 06:40:02 -07:00
blk-throttle.c
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: Discard page cache of zone reset target range 2021-03-11 11:49:25 -07:00
blk.h block: introduce blk_queue_clear_zone_settings() 2021-02-10 07:44:41 -07:00
bounce.c block: rename BIO_MAX_PAGES to BIO_MAX_VECS 2021-03-11 07:47:48 -07:00
bsg-lib.c
bsg.c
cmdline-parser.c
elevator.c
genhd.c block: Suppress uevent for hidden device when removed 2021-03-11 11:48:25 -07:00
ioctl.c block: reopen the device in blkdev_reread_part 2021-02-23 19:23:22 -07:00
ioprio.c
keyslot-manager.c - Fix DM integrity's HMAC support to provide enhanced security of 2021-02-22 10:22:54 -08:00
kyber-iosched.c kyber: introduce kyber_depth_updated() 2021-02-22 12:37:57 -07:00
mq-deadline.c block: get rid of the trace rq insert wrapper 2021-02-22 06:37:41 -07:00
opal_proto.h
scsi_ioctl.c
sed-opal.c
t10-pi.c