From: Jan Kara <jack@suse.cz>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Jan Kara <jack@suse.com>, Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] udf: shut up pointer cast warning
Date: Wed, 10 Nov 2021 12:00:38 +0100 [thread overview]
Message-ID: <20211110110038.GA4048@quack2.suse.cz> (raw)
In-Reply-To: <20211109123621.52474-1-arnd@kernel.org>
On Tue 09-11-21 13:36:08, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> On 32-bit architectures, the workaround of storing the directory position
> in the private_data pointer causes a warning, as loff_t does not fit in
> a pointer:
>
> fs/udf/dir.c: In function 'udf_readdir':
> fs/udf/dir.c:78:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 78 | if (ctx->pos != (uintptr_t)file->private_data) {
> | ^
> fs/udf/dir.c:211:30: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> 211 | file->private_data = (void *)(uintptr_t)ctx->pos;
> | ^
>
> An extra cast to uintptr_t shuts up the warning. This is of course
> still broken if the position is ever beyond the first 2^32 bytes (4GB).
>
> I have not found a clear information on whether directories this
> large are allowed on UDF, but it seems unlikely.
>
> Fixes: 39a464de961f ("udf: Fix crash after seekdir")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks Arnd but the problem was actually (mostly theoretical) problem on
32-bita archs and furthermore I've realized it didn't completely fix the
original problem either. Yesterday I've pushed a different fix to
linux-next. So the warning should disappear.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-11-10 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-09 12:36 [PATCH] udf: shut up pointer cast warning Arnd Bergmann
2021-11-10 11:00 ` Jan Kara [this message]
2021-11-10 11:22 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211110110038.GA4048@quack2.suse.cz \
--to=jack@suse.cz \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox