Skip to content

Commit 60f71f2

Browse files
committed
dm integrity: fix gcc 5 warning
JIRA: https://issues.redhat.com/browse/RHEL-59523 Upstream Status: kernel/git/torvalds/linux.git commit a8fa648 Author: Mikulas Patocka <mpatocka@redhat.com> Date: Tue Sep 3 11:50:11 2024 +0200 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: Geert Uytterhoeven <geert@linux-m68k.org> Fixes: fb09876 ("dm-integrity: introduce the Inline mode") Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
1 parent 1838dd9 commit 60f71f2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/md/dm-integrity.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4717,13 +4717,18 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv
47174717
ti->error = "Block size doesn't match the information in superblock";
47184718
goto bad;
47194719
}
4720-
if (!le32_to_cpu(ic->sb->journal_sections) != (ic->mode == 'I')) {
4721-
r = -EINVAL;
4722-
if (ic->mode != 'I')
4720+
if (ic->mode != 'I') {
4721+
if (!le32_to_cpu(ic->sb->journal_sections)) {
4722+
r = -EINVAL;
47234723
ti->error = "Corrupted superblock, journal_sections is 0";
4724-
else
4724+
goto bad;
4725+
}
4726+
} else {
4727+
if (le32_to_cpu(ic->sb->journal_sections)) {
4728+
r = -EINVAL;
47254729
ti->error = "Corrupted superblock, journal_sections is not 0";
4726-
goto bad;
4730+
goto bad;
4731+
}
47274732
}
47284733
/* make sure that ti->max_io_len doesn't overflow */
47294734
if (!ic->meta_dev) {

0 commit comments

Comments
 (0)