Re: [bug report] dm: add integrity target

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

 




On Mon, 13 Mar 2017, Dan Carpenter wrote:

> Hello Mikulas Patocka,
> 
> The patch dfab77c854fc: "dm: add integrity target" from Jan 4, 2017,
> leads to the following static checker warning:

Hi

I already removed this condition in my code. It comes from an old version 
where interleaving could be disabled and disabled interleaving was 
indicated by "-1". The current version always uses interleaving, so this 
condition is pointless.

Mikulas

> 	drivers/md/dm-integrity.c:2653 dm_integrity_ctr()
> 	warn: always true condition '(ic->sb->log2_interleave_sectors != -1) => (0-255 != (-1))'
> 
> drivers/md/dm-integrity.c
>   2647          if (le16_to_cpu(ic->sb->integrity_tag_size) != ic->tag_size) {
>   2648                  r = -EINVAL;
>   2649                  ti->error = "Invalid tag size";
>   2650                  goto bad;
>   2651          }
>   2652          /* make sure that ti->max_io_len doesn't overflow */
>   2653          if (ic->sb->log2_interleave_sectors != -1 && (ic->sb->log2_interleave_sectors < MIN_INTERLEAVE_SECTORS || ic->sb->log2_interleave_sectors > MAX_INTERLEAVE_SECTORS)) {
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Impossible!  Also this line is really really really long so it doesn't
> even fit in my email client.  It's like a million characters long.
> 
>   2654                  r = -EINVAL;
>   2655                  ti->error = "Invalid interleave_sectors in the superblock";
>   2656                  goto bad;
>   2657          }
>  
> 
> regards,
> dan carpenter
> 

--
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