[dm-devel] [PATCH] libmultipath: I/O access overrun occured in mutipath device under the displayed capacity

Bart Van Assche bart.vanassche at sandisk.com
Wed Oct 26 18:10:01 UTC 2016


On 10/25/2016 08:18 PM, zhou.guichun at zte.com.cn wrote:
> From: zhouguichun <zhou.guichun at zte.com.cn>
>
> I/O access overrun occured in mutipath device under
> the displayed capacity since that the displayed
> capacity is greater than the real capacity
> (Eg. a 3456M disk display as 3.4G).
>
> In this patch, we keep the displayed capacity three
> decimals by abandoning the rest of decimals instead
> of by rounding up(Eg. a 3.4567G disk display as
> 3.456G), so that the displayed capacity will not be
> greater than the real capacity, and the error will
> also be in a permissible range.

The motivation of this patch looks really weird to me. How could the 
rounding in snprint_size() cause an access past the end of a block 
device? Using the output of that function as block device size is wrong. 
Please use /sys/class/block/dm*/size instead.

Bart.




More information about the dm-devel mailing list