Re: [PATCH blktests] Fix build failure for discontiguous-io on 32-bit platforms

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

 



On Mon, 2018-10-29 at 12:15 -0400, Theodore Ts'o wrote:
+AD4 Signed-off-by: Theodore Ts'o +ADw-tytso+AEA-mit.edu+AD4
+AD4 ---
+AD4  src/discontiguous-io.cpp +AHw 2 +--
+AD4  1 file changed, 1 insertion(+-), 1 deletion(-)
+AD4 
+AD4 diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp
+AD4 index 5e0ee0f..a59c18d 100644
+AD4 --- a/src/discontiguous-io.cpp
+AD4 +-+-+- b/src/discontiguous-io.cpp
+AD4 +AEAAQA -291,7 +-291,7 +AEAAQA int main(int argc, char +ACoAKg-argv)
+AD4  			unsigned char +ACo-p +AD0 +ACYAKg-buf.begin()+ADs
+AD4  			for (int i +AD0 0+ADs i +ADw len / 4+ADs i+-+-)
+AD4  				iov.append(p +- 4 +- i +ACo 8,
+AD4 -					   std::min(4ul, len - i +ACo 4))+ADs
+AD4 +-					   std::min(4ul, (unsigned long) len - i +ACo 4))+ADs
+AD4  		+AH0 else +AHs
+AD4  			iov.append(+ACYAKg-buf.begin(), buf.size())+ADs
+AD4  		+AH0

Hi Ted,

Have you considered to change the data type of 'len' from size+AF8-t into unsigned long
instead of inserting this cast? That would make it clear that no integer truncation
happens in the iov.append() call.

Thanks,

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux