linux/drivers/block/drbd
Lars Ellenberg 6675700139 drbd: bm_page_async_io: fix spurious bitmap "IO error" on large volumes
We usually do all our bitmap IO in units of PAGE_SIZE.

With very small or oddly sized external meta data, or with
PAGE_SIZE != 4k, it can happen that our last on-disk bitmap page
is not fully PAGE_SIZE aligned, so we may need to adjust the size
of the IO.

We used to do that with
  min_t(unsigned int, PAGE_SIZE,
	last_allowed_sector - current_offset);
And for just the right diff, (unsigned int)(diff) will result in 0.

A bio of length 0 will correctly be rejected with an IO error
(and some scary WARN_ON_ONCE()) by the scsi layer.

Do the calculation properly.

Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20220622204932.196830-1-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-02 17:14:31 -06:00
..
drbd_actlog.c block/drbd: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:31 -06:00
drbd_bitmap.c drbd: bm_page_async_io: fix spurious bitmap "IO error" on large volumes 2022-08-02 17:14:31 -06:00
drbd_debugfs.c block: drbd: no need to check return value of debugfs_create functions 2019-06-20 03:28:16 -06:00
drbd_debugfs.h block: drbd: no need to check return value of debugfs_create functions 2019-06-20 03:28:16 -06:00
drbd_int.h block/drbd: Combine two drbd_submit_peer_request() arguments 2022-07-14 12:14:31 -06:00
drbd_interval.c block: drbd: drbd_interval: Demote some kernel-doc abuses and fix another header 2021-04-06 09:21:53 -06:00
drbd_interval.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drbd_main.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
drbd_nl.c drdb: Switch to kvfree_rcu() API 2022-04-17 19:54:24 -06:00
drbd_nla.c netlink: make validation more configurable for future strictness 2019-04-27 17:07:21 -04:00
drbd_nla.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drbd_proc.c drbd: remove a bogus bdi_rw_congested call 2020-07-08 17:05:53 -06:00
drbd_protocol.h drbd: Use struct_group() to zero algs 2021-12-13 16:31:24 -07:00
drbd_receiver.c block/drbd: Combine two drbd_submit_peer_request() arguments 2022-07-14 12:14:31 -06:00
drbd_req.c drbd: stop using bdevname in drbd_report_io_error 2022-07-14 10:27:56 -06:00
drbd_req.h drbd: remove drbd_req_make_private_bio 2021-01-27 09:51:48 -07:00
drbd_state_change.h drbd: Fix five use after free bugs in get_initial_state 2022-04-06 13:07:50 -06:00
drbd_state.c drdb: Switch to kvfree_rcu() API 2022-04-17 19:54:24 -06:00
drbd_state.h drbd: Change drbd_request_detach_interruptible's return type to int 2018-12-20 09:51:31 -07:00
drbd_strings.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 91 2019-05-24 17:37:53 +02:00
drbd_strings.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drbd_vli.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 91 2019-05-24 17:37:53 +02:00
drbd_worker.c block/drbd: Combine two drbd_submit_peer_request() arguments 2022-07-14 12:14:31 -06:00
Kconfig Replace HTTP links with HTTPS ones: DRBD driver 2020-07-05 14:16:44 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00