Skip to content

Commit

Permalink
ubifs: Fix ino_t format warnings in orphan_delete()
Browse files Browse the repository at this point in the history
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: 8009ce9 ("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>
  • Loading branch information
geertu authored and richardweinberger committed Jan 16, 2020
1 parent f5de5b8 commit 155fc6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ubifs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ static void __orphan_drop(struct ubifs_info *c, struct ubifs_orphan *o)
static void orphan_delete(struct ubifs_info *c, struct ubifs_orphan *orph)
{
if (orph->del) {
dbg_gen("deleted twice ino %lu", orph->inum);
dbg_gen("deleted twice ino %lu", (unsigned long)orph->inum);
return;
}

if (orph->cmt) {
orph->del = 1;
orph->dnext = c->orph_dnext;
c->orph_dnext = orph;
dbg_gen("delete later ino %lu", orph->inum);
dbg_gen("delete later ino %lu", (unsigned long)orph->inum);
return;
}

Expand Down

0 comments on commit 155fc6b

Please sign in to comment.