From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Priebe <s.priebe@profihost.ag>
Cc: peter.maydell@linaro.org, sw@weilnetz.de, qemu-devel@nongnu.org,
stefanha@gmail.com, josh.durgin@inktank.com,
ceph-devel@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] overflow of int ret: use ssize_t for ret
Date: Thu, 22 Nov 2012 17:40:48 +0100 [thread overview]
Message-ID: <50AE5590.5010804@suse.de> (raw)
In-Reply-To: <1353575275-1343-1-git-send-email-s.priebe@profihost.ag>
Am 22.11.2012 10:07, schrieb Stefan Priebe:
> When acb->cmd is WRITE or DISCARD block/rbd stores rcb->size into acb->ret
>
> Look here:
> if (acb->cmd == RBD_AIO_WRITE ||
> acb->cmd == RBD_AIO_DISCARD) {
> if (r < 0) {
> acb->ret = r;
> acb->error = 1;
> } else if (!acb->error) {
> acb->ret = rcb->size;
> }
>
> right now acb->ret is just an int and we might get an overflow if size is too big.
> For discards rcb->size holds the size of the discard - this might be some TB if you
> discard a whole device.
>
> The steps to reproduce are:
> mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends a discard. Important is that you use scsi-hd and set discard_granularity=512. Otherwise rbd disabled discard support.
Whatever type you decide to use, please add an identifying topic such as
"block/rbd:" in the subject (int ret is very generic!), and this patch
is missing a Signed-off-by.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-11-22 16:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 9:07 [Qemu-devel] [PATCH] overflow of int ret: use ssize_t for ret Stefan Priebe
2012-11-22 16:40 ` Andreas Färber [this message]
2012-11-22 19:09 ` Stefan Priebe - Profihost AG
2012-11-22 19:37 ` Stefan Weil
2012-11-22 20:49 ` Stefan Priebe - Profihost AG
2012-11-23 14:11 ` Stefan Hajnoczi
2012-11-23 14:15 ` Peter Maydell
2012-11-23 14:38 ` Stefan Priebe - Profihost AG
2012-11-23 15:56 ` Stefan Hajnoczi
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=50AE5590.5010804@suse.de \
--to=afaerber@suse.de \
--cc=ceph-devel@vger.kernel.org \
--cc=josh.durgin@inktank.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=s.priebe@profihost.ag \
--cc=stefanha@gmail.com \
--cc=sw@weilnetz.de \
/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;
as well as URLs for NNTP newsgroup(s).