All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] dm: add integrity target
@ 2017-03-13 10:01 Dan Carpenter
  2017-03-15 12:23 ` Mikulas Patocka
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-03-13 10:01 UTC (permalink / raw)
  To: mpatocka; +Cc: dm-devel

Hello Mikulas Patocka,

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

	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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] dm: add integrity target
  2017-03-13 10:01 [bug report] dm: add integrity target Dan Carpenter
@ 2017-03-15 12:23 ` Mikulas Patocka
  0 siblings, 0 replies; 2+ messages in thread
From: Mikulas Patocka @ 2017-03-15 12:23 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: dm-devel



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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-15 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 10:01 [bug report] dm: add integrity target Dan Carpenter
2017-03-15 12:23 ` Mikulas Patocka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.