From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH blktests] Fix build failure for discontiguous-io on 32-bit platforms
Date: Mon, 29 Oct 2018 17:08:22 -0400 [thread overview]
Message-ID: <20181029210822.GA15839@thunk.org> (raw)
In-Reply-To: <1540830403.196084.50.camel@acm.org>
On Mon, Oct 29, 2018 at 09:26:43AM -0700, Bart Van Assche wrote:
>
> Have you considered to change the data type of 'len' from size_t into unsigned long
> instead of inserting this cast? That would make it clear that no integer truncation
> happens in the iov.append() call.
Well the potential integer truncation that could happen is here:
case 'l': len = strtoul(optarg, NULL, 0); break;
... but I really don't think the user would ever send a length >
2**32, and I have a sneaking suspicion that ib_srp has zero change of
working on 32-bit systems (which is what uses this function) so this
was more about making sure blktests would build when I'm building the
32-bit version of my test appliance VM.
(For that matter, I've been banging my head against a brick wall
trying to make the srp tests work in either a KVM or GCE environment,
even with a 64-bit VM, but that's a different issue. It's not high
priority for me, at the moment, but eventually I would like the
{kvm,gce,android}-xfstest test appliance VM's generated by the
xfstests-bld repo to be able to run all of blktests.)
If folks have strong opinions about what's the best way to fix this,
I'm happy to adjust the patch. (I personally don't care that much).
What offends me more is that later on there are scopes when len gets
shadowed with a "ssize_t len;" definition --- I whould have thought
gcc or clang would have complained bitterly about that, but I guess
not. I didn't want to make that many clean up changes, especially
since I'm not in a position to test any changes that I make, since as
I mentioned the srp blktests are failing miserably for me.
- Ted
next prev parent reply other threads:[~2018-10-30 5:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 16:15 [PATCH blktests] Fix build failure for discontiguous-io on 32-bit platforms Theodore Ts'o
2018-10-29 16:26 ` Bart Van Assche
2018-10-29 21:08 ` Theodore Y. Ts'o [this message]
2018-10-29 21:32 ` Bart Van Assche
2018-10-29 23:22 ` Theodore Y. Ts'o
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=20181029210822.GA15839@thunk.org \
--to=tytso@mit.edu \
--cc=bvanassche@acm.org \
--cc=linux-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.