Merge tag 'block-6.9-20240510' of git://git.kernel.dk/linux
[linux-block.git] / block / blk-settings.c
index d2731843f2fccb481eda94e1a1dc980051d2486a..9d6033e01f2e170307cbe5ffdb0365d1eb5c8b9b 100644 (file)
@@ -188,7 +188,10 @@ static int blk_validate_limits(struct queue_limits *lim)
         * bvec and lower layer bio splitting is supposed to handle the two
         * correctly.
         */
-       if (!lim->virt_boundary_mask) {
+       if (lim->virt_boundary_mask) {
+               if (!lim->max_segment_size)
+                       lim->max_segment_size = UINT_MAX;
+       } else {
                /*
                 * The maximum segment size has an odd historic 64k default that
                 * drivers probably should override.  Just like the I/O size we