Commit a8fa6483 authored by Mikulas Patocka's avatar Mikulas Patocka
Browse files

dm integrity: fix gcc 5 warning



This commit fixes gcc 5 warning "logical not is only applied to the left
hand side of comparison"

Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Fixes: fb098768 ("dm-integrity: introduce the Inline mode")
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
parent 26207c63
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -4715,14 +4715,19 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
		ti->error = "Block size doesn't match the information in superblock";
		goto bad;
	}
	if (!le32_to_cpu(ic->sb->journal_sections) != (ic->mode == 'I')) {
	if (ic->mode != 'I') {
		if (!le32_to_cpu(ic->sb->journal_sections)) {
			r = -EINVAL;
		if (ic->mode != 'I')
			ti->error = "Corrupted superblock, journal_sections is 0";
		else
			goto bad;
		}
	} else {
		if (le32_to_cpu(ic->sb->journal_sections)) {
			r = -EINVAL;
			ti->error = "Corrupted superblock, journal_sections is not 0";
			goto bad;
		}
	}
	/* make sure that ti->max_io_len doesn't overflow */
	if (!ic->meta_dev) {
		if (ic->sb->log2_interleave_sectors < MIN_LOG2_INTERLEAVE_SECTORS ||