Re: [PATCHv8 2/2] loop: support 4k physical blocksize

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

 



On 06/09/2017 09:30 AM, Bart Van Assche wrote:
> On 06/08/17 04:46, Hannes Reinecke wrote:
>>  	if (lo->lo_offset != info->lo_offset ||
>> -	    lo->lo_sizelimit != info->lo_sizelimit)
>> -		if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit)) {
>> +	    lo->lo_sizelimit != info->lo_sizelimit ||
>> +	    lo->lo_flags != lo_flags ||
>> +	    ((lo->lo_flags & LO_FLAGS_BLOCKSIZE) &&
>> +	     lo->lo_logical_blocksize != LO_INFO_BLOCKSIZE(info))) {
>> +		if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit,
>> +				     LO_INFO_BLOCKSIZE(info)))
>>  			err = -EFBIG;
>>  			goto exit;
>>  		}
> 
> Hello Hannes and Jens,
> 
> gcc reports the following for the above code:
> 
> drivers/block/loop.c:1149:3: warning: this 'if' clause does not guard...
> [-Wmisleading-indentation]
> 
> Please review this code. Have the braces perhaps been misplaced?

It's clearly buggy, fix has gone in:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.13/block&id=b040ad9cf6a169cc000a5324fcada695dfa1f4b3

-- 
Jens Axboe




[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