Accepting request 1193357 from network:ha-clustering:Factory

OBS-URL: https://build.opensuse.org/request/show/1193357
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=110
This commit is contained in:
Dominique Leuenberger 2024-08-12 10:32:09 +00:00 committed by Git OBS Bridge
commit a156897b31
3 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,59 @@
diff -Nupr a/drbd/drbd_nl.c b/drbd/drbd_nl.c
--- a/drbd/drbd_nl.c 2024-08-12 15:03:18.458476462 +0800
+++ b/drbd/drbd_nl.c 2024-08-12 15:05:08.415670056 +0800
@@ -2017,6 +2017,55 @@ static void fixup_discard_support(struct
}
}
+/**
+ * blk_queue_max_hw_sectors - set max sectors for a request for this queue
+ * @q: the request queue for the device
+ * @max_hw_sectors: max hardware sectors in the usual 512b unit
+ *
+ * Description:
+ * Enables a low level driver to set a hard upper limit,
+ * max_hw_sectors, on the size of requests. max_hw_sectors is set by
+ * the device driver based upon the capabilities of the I/O
+ * controller.
+ *
+ * max_dev_sectors is a hard limit imposed by the storage device for
+ * READ/WRITE requests. It is set by the disk driver.
+ *
+ * max_sectors is a soft limit imposed by the block layer for
+ * filesystem type requests. This value can be overridden on a
+ * per-device basis in /sys/block/<device>/queue/max_sectors_kb.
+ * The soft limit can not exceed max_hw_sectors.
+ **/
+static void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
+{
+ struct queue_limits *limits = &q->limits;
+ unsigned int max_sectors;
+
+ if ((max_hw_sectors << 9) < PAGE_SIZE) {
+ max_hw_sectors = 1 << (PAGE_SHIFT - 9);
+ pr_info("%s: set to minimum %u\n", __func__, max_hw_sectors);
+ }
+
+ max_hw_sectors = round_down(max_hw_sectors,
+ limits->logical_block_size >> SECTOR_SHIFT);
+ limits->max_hw_sectors = max_hw_sectors;
+
+ max_sectors = min_not_zero(max_hw_sectors, limits->max_dev_sectors);
+
+ if (limits->max_user_sectors)
+ max_sectors = min(max_sectors, limits->max_user_sectors);
+ else
+ max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS_CAP);
+
+ max_sectors = round_down(max_sectors,
+ limits->logical_block_size >> SECTOR_SHIFT);
+ limits->max_sectors = max_sectors;
+
+ if (!q->disk)
+ return;
+ q->disk->bdi->io_pages = max_sectors >> (PAGE_SHIFT - 9);
+}
+
void drbd_reconsider_queue_parameters(struct drbd_device *device, struct drbd_backing_dev *bdev)
{
struct request_queue * const q = device->rq_queue;

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 12 07:37:42 UTC 2024 - heming zhao <heming.zhao@suse.com>
- drbd: fix build error against kernel v6.10.3 (boo#1229062)
* add patch
+ boo1229062-re-enable-blk_queue_max_hw_sectors.patch
-------------------------------------------------------------------
Wed Jun 19 07:54:17 UTC 2024 - heming zhao <heming.zhao@suse.com>

View File

@ -66,6 +66,7 @@ Patch0026: 0026-compat-gate-blkdev_-patches-behind-bdev_open_by_path.patch
Patch1001: bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch
Patch1002: suse-coccinelle.patch
Patch1003: bsc1226510-fix-build-err-against-6.9.3.patch
Patch1004: boo1229062-re-enable-blk_queue_max_hw_sectors.patch
########################
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py