@@ -2690,6 +2690,14 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
2690
2690
int id ;
2691
2691
int vnr = adm_ctx -> volume ;
2692
2692
enum drbd_ret_code err = ERR_NOMEM ;
2693
+ struct queue_limits lim = {
2694
+ /*
2695
+ * Setting the max_hw_sectors to an odd value of 8kibyte here.
2696
+ * This triggers a max_bio_size message upon first attach or
2697
+ * connect.
2698
+ */
2699
+ .max_hw_sectors = DRBD_MAX_BIO_SIZE_SAFE >> 8 ,
2700
+ };
2693
2701
2694
2702
device = minor_to_device (minor );
2695
2703
if (device )
@@ -2708,7 +2716,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
2708
2716
2709
2717
drbd_init_set_defaults (device );
2710
2718
2711
- disk = blk_alloc_disk (NULL , NUMA_NO_NODE );
2719
+ disk = blk_alloc_disk (& lim , NUMA_NO_NODE );
2712
2720
if (IS_ERR (disk )) {
2713
2721
err = PTR_ERR (disk );
2714
2722
goto out_no_disk ;
@@ -2729,9 +2737,6 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
2729
2737
2730
2738
blk_queue_flag_set (QUEUE_FLAG_STABLE_WRITES , disk -> queue );
2731
2739
blk_queue_write_cache (disk -> queue , true, true);
2732
- /* Setting the max_hw_sectors to an odd value of 8kibyte here
2733
- This triggers a max_bio_size message upon first attach or connect */
2734
- blk_queue_max_hw_sectors (disk -> queue , DRBD_MAX_BIO_SIZE_SAFE >> 8 );
2735
2740
2736
2741
device -> md_io .page = alloc_page (GFP_KERNEL );
2737
2742
if (!device -> md_io .page )
0 commit comments