From: Andrew Morton <akpm@osdl.org>
To: mike.miller@hp.com
Cc: mikem@beardog.cca.cpqcorp.net, axboe@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: cciss update for 2.6.7-rc1
Date: Fri, 4 Jun 2004 13:42:51 -0700 [thread overview]
Message-ID: <20040604134251.70a1ffef.akpm@osdl.org> (raw)
In-Reply-To: <20040602201326.GA1346@beardog.cca.cpqcorp.net>
mikem@beardog.cca.cpqcorp.net wrote:
>
>
> This patch provides a conversion routine for 32-bit user space apps that
> call into a 64-bit kernel on x86_64 architectures. This is required for
> the HP Array Configuration utility and the HP management agents. Without
> this patch the apps will not function. The 2 ioctls affected are the cciss
> pass thru ioctls.
>
> Caveat: it spits out 2 warnings during compilation. I've tried everything
> I can think of to clean them up, but... If anyone has any helpful
> suggestions I'm all ears.
The below fixes up the warnings. Please test it?
It's very unusual for a disk driver to have `#ifdef __x86_64__' stuff in
it. Is this problem really unique to x86_64 or should the new code be
enabled for all 64-bit architectures?
--- 25-x86_64/drivers/block/cciss.c~cciss-update-warning-fix Fri Jun 4 13:40:20 2004
+++ 25-x86_64-akpm/drivers/block/cciss.c Fri Jun 4 13:42:22 2004
@@ -532,13 +532,16 @@ int cciss_ioctl32_passthru(unsigned int
IOCTL_Command_struct arg64;
mm_segment_t old_fs;
int err;
+ unsigned long cp;
err = 0;
err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request));
err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
err |= get_user(arg64.buf_size, &arg32->buf_size);
- err |= get_user(arg64.buf, &arg32->buf);
+ err |= get_user(cp, &arg32->buf);
+ arg64.buf = (BYTE *)cp;
+
if (err)
return -EFAULT;
@@ -561,6 +564,7 @@ int cciss_ioctl32_big_passthru(unsigned
BIG_IOCTL_Command_struct arg64;
mm_segment_t old_fs;
int err;
+ unsigned long cp;
err = 0;
err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
@@ -568,8 +572,12 @@ int cciss_ioctl32_big_passthru(unsigned
err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
err |= get_user(arg64.buf_size, &arg32->buf_size);
err |= get_user(arg64.malloc_size, &arg32->malloc_size);
- err |= get_user(arg64.buf, &arg32->buf);
- if (err) return -EFAULT;
+ err |= get_user(cp, &arg32->buf);
+ arg64.buf = (BYTE *)cp;
+
+ if (err)
+ return -EFAULT;
+
old_fs = get_fs();
set_fs(KERNEL_DS);
err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) &arg64);
_
next prev parent reply other threads:[~2004-06-04 20:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 20:13 cciss update for 2.6.7-rc1 mikem
2004-06-04 20:42 ` Andrew Morton [this message]
2004-06-04 20:53 ` viro
[not found] <23tkF-7Hg-29@gated-at.bofh.it>
2004-06-04 21:59 ` Andi Kleen
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=20040604134251.70a1ffef.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.miller@hp.com \
--cc=mikem@beardog.cca.cpqcorp.net \
/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