[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1581937397.24882.1571222675188.JavaMail.zimbra@nod.at>
Date: Wed, 16 Oct 2019 12:44:35 +0200 (CEST)
From: Richard Weinberger <richard@....at>
To: "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>
Cc: linux-kernel@...ts.codethink.co.uk,
Artem Bityutskiy <dedekind1@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-mtd <linux-mtd@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ubifs: possible missed le64_to_cpu() in journal
----- Ursprüngliche Mail -----
> Von: "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>
> An: linux-kernel@...ts.codethink.co.uk
> CC: "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>, "richard" <richard@....at>, "Artem Bityutskiy"
> <dedekind1@...il.com>, "Adrian Hunter" <adrian.hunter@...el.com>, "linux-mtd" <linux-mtd@...ts.infradead.org>,
> "linux-kernel" <linux-kernel@...r.kernel.org>
> Gesendet: Mittwoch, 16. Oktober 2019 12:08:03
> Betreff: [PATCH] ubifs: possible missed le64_to_cpu() in journal
> In the ubifs_jnl_write_inode() functon, it calls ubifs_iget()
> with xent->inum. The xent->inum is __le64, but the ubifs_iget()
> takes native cpu endian.
>
> I think that this should be changed to passing le64_to_cpu(xent->inum)
> to fix the following sparse warning:
>
> fs/ubifs/journal.c:902:58: warning: incorrect type in argument 2 (different base
> types)
> fs/ubifs/journal.c:902:58: expected unsigned long inum
> fs/ubifs/journal.c:902:58: got restricted __le64 [usertype] inum
>
> Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
> ---
> Cc: Richard Weinberger <richard@....at>
> Cc: Artem Bityutskiy <dedekind1@...il.com>
> Cc: Adrian Hunter <adrian.hunter@...el.com>
> Cc: linux-mtd@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> ---
> fs/ubifs/journal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
> index d6136f7c1cfc..388fe8f5dc51 100644
> --- a/fs/ubifs/journal.c
> +++ b/fs/ubifs/journal.c
> @@ -899,7 +899,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct
> inode *inode)
> fname_name(&nm) = xent->name;
> fname_len(&nm) = le16_to_cpu(xent->nlen);
>
> - xino = ubifs_iget(c->vfs_sb, xent->inum);
> + xino = ubifs_iget(c->vfs_sb, le64_to_cpu(xent->inum));
Good catch!
Thanks,
//richard
Powered by blists - more mailing lists