qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Bogdan Purcareata <bogdan.purcareata@freescale.com>,
	qemu-devel@nongnu.org, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] nbd/trivial: fix type cast for ioctl
Date: Fri, 03 Apr 2015 16:15:53 +0200	[thread overview]
Message-ID: <551EA099.4070702@redhat.com> (raw)
In-Reply-To: <1428058914-32050-1-git-send-email-bogdan.purcareata@freescale.com>



On 03/04/2015 13:01, Bogdan Purcareata wrote:
> This fixes ioctl behavior on powerpc e6500 platforms with 64bit kernel and 32bit
> userspace. The current type cast has no effect there and the value passed to the
> kernel is still 0. Probably an issue related to the compiler, since I'm assuming
> the same configuration works on a similar setup on x86.
> 
> Also ensure consistency with previous type cast in TRACE message.
> 
> Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
> ---
>  nbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/nbd.c b/nbd.c
> index 91b7d56..da81a5b 100644
> --- a/nbd.c
> +++ b/nbd.c
> @@ -681,7 +681,7 @@ int nbd_init(int fd, int csock, uint32_t flags, off_t size)
>  
>      TRACE("Setting size to %zd block(s)", (size_t)(size / BDRV_SECTOR_SIZE));
>  
> -    if (ioctl(fd, NBD_SET_SIZE_BLOCKS, size / (size_t)BDRV_SECTOR_SIZE) < 0) {
> +    if (ioctl(fd, NBD_SET_SIZE_BLOCKS, (size_t)(size / BDRV_SECTOR_SIZE) < 0)) {
>          int serrno = errno;
>          LOG("Failed setting size (in blocks)");
>          return -serrno;
> 

Thanks, queued for 2.4.

Cc: qemu-stable@nongnu.org

  reply	other threads:[~2015-04-03 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 11:01 [Qemu-devel] [PATCH] nbd/trivial: fix type cast for ioctl Bogdan Purcareata
2015-04-03 14:15 ` Paolo Bonzini [this message]
2015-04-03 14:44   ` Michael Tokarev
2015-04-06  7:15     ` Purcareata Bogdan

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=551EA099.4070702@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bogdan.purcareata@freescale.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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;
as well as URLs for NNTP newsgroup(s).