How can need dm use limits.max_hw_sectors from the bdev?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I'm writing a trivial dm target and hitting errors like this:
   io too big device loop0 (2048 > 255)

which looks like the problem described here:
	https://bugzilla.kernel.org/show_bug.cgi?id=9401#c3

and is is consistent:
	cat /sys/block/loop0/queue/max_hw_sectors_kb 
	127
	# cat /sys/block/dm-4/queue/max_hw_sectors_kb 
	2147483647

By tracing from sysfs it looks like I need to do something like this when 
called from the target constructor (dm_ctr_fn target_type.ctr) function:

    target->table->md->queue->limits.max_hw_sectors =
        priv->dm_dev_bdev->bdev->bd_queue->limits.max_hw_sectors;

but I cannot because `struct md` and `struct mapped_device` are opaque
which makes me think there is a better (correct) way to do this.  Is there a way
to change my target device's max_hw_sectors value to 127?

Is there some other generic solution?

Would late bio splitting solve this?

-Eric

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux