Message ID | 1428304781-1205-1-git-send-email-bogdan.purcareata@freescale.com |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1EF47140142 for <incoming@patchwork.ozlabs.org>; Mon, 6 Apr 2015 17:35:12 +1000 (AEST) Received: from localhost ([::1]:38946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1Yf1Yr-000585-Oo for incoming@patchwork.ozlabs.org; Mon, 06 Apr 2015 03:35:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <B43198@freescale.com>) id 1Yf1YV-0004cu-Pn for qemu-devel@nongnu.org; Mon, 06 Apr 2015 03:34:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <B43198@freescale.com>) id 1Yf1YQ-00060W-Hk for qemu-devel@nongnu.org; Mon, 06 Apr 2015 03:34:47 -0400 Received: from mail-bl2on0102.outbound.protection.outlook.com ([65.55.169.102]:37072 helo=na01-bl2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <B43198@freescale.com>) id 1Yf1YQ-00060M-Df for qemu-devel@nongnu.org; Mon, 06 Apr 2015 03:34:42 -0400 Received: from BN3PR0301CA0037.namprd03.prod.outlook.com (25.160.180.175) by BLUPR03MB052.namprd03.prod.outlook.com (10.255.209.152) with Microsoft SMTP Server (TLS) id 15.1.112.19; Mon, 6 Apr 2015 07:19:47 +0000 Received: from BN1AFFO11FD036.protection.gbl (2a01:111:f400:7c10::160) by BN3PR0301CA0037.outlook.office365.com (2a01:111:e400:4000::47) with Microsoft SMTP Server (TLS) id 15.1.130.23 via Frontend Transport; Mon, 6 Apr 2015 07:19:47 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; redhat.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD036.mail.protection.outlook.com (10.58.52.240) with Microsoft SMTP Server (TLS) id 15.1.136.16 via Frontend Transport; Mon, 6 Apr 2015 07:19:46 +0000 Received: from localhost.localdomain (fsr-ub1464-106.ea.freescale.net [10.171.74.79]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t367JgLk008377; Mon, 6 Apr 2015 00:19:43 -0700 From: Bogdan Purcareata <bogdan.purcareata@freescale.com> To: <qemu-devel@nongnu.org>, <mjt@tls.msk.ru>, <pbonzini@redhat.com> Date: Mon, 6 Apr 2015 07:19:41 +0000 Message-ID: <1428304781-1205-1-git-send-email-bogdan.purcareata@freescale.com> X-Mailer: git-send-email 2.1.4 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(19580405001)(48376002)(46102003)(105606002)(50466002)(6806004)(229853001)(104016003)(107886001)(92566002)(19580395003)(50986999)(33646002)(87936001)(47776003)(49486002)(77156002)(62966003)(50226001)(106466001)(36756003)(77096005); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB052; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB052; X-Microsoft-Antispam-PRVS: <BLUPR03MB052C2CF6D48B4A347CE602D8CFE0@BLUPR03MB052.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:BLUPR03MB052; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB052; X-Forefront-PRVS: 0538A71254 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2015 07:19:46.6592 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB052 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 65.55.169.102 Subject: [Qemu-devel] [PATCH v2] nbd/trivial: fix type cast for ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org |
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;
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. - v2: paranthesis fix Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> --- nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)