]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Fix ino_t format warnings in orphan_delete()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 13 Jan 2020 10:51:56 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:43:50 +0000 (16:43 +0100)
commit8c0b296c68ccf5e0ab41951aa7fbf2186612f88c
tree1b62236f31ed013e4288bc5a6832f5987427f649
parent9bac4660f0e7de64439588b2557241a688bfde25
ubifs: Fix ino_t format warnings in orphan_delete()

commit 52961bfb7465b9520ba5d8e79ee6ed840e2b6b89 upstream.

On alpha and s390x:

    fs/ubifs/debug.h:158:11: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t {aka unsigned int}’ [-Wformat=]
    ...
    fs/ubifs/orphan.c:132:3: note: in expansion of macro ‘dbg_gen’
       dbg_gen("deleted twice ino %lu", orph->inum);
    ...
    fs/ubifs/orphan.c:140:3: note: in expansion of macro ‘dbg_gen’
       dbg_gen("delete later ino %lu", orph->inum);

__kernel_ino_t is "unsigned long" on most architectures, but not on
alpha and s390x, where it is "unsigned int".  Hence when printing an
ino_t, it should always be cast to "unsigned long" first.

Fix this by re-adding the recently removed casts.

Fixes: f58ff412d12a612d ("ubifs: Don't leak orphans on memory during commit")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ubifs/orphan.c