* [PATCH] Fix unaligned faults in putstat64
@ 2003-10-10 18:44 Arun Sharma
0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2003-10-10 18:44 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 78 bytes --]
This seems to be introduced by recent changes in 2.6.0-test series.
-Arun
[-- Attachment #2: putstat64-align.patch --]
[-- Type: text/plain, Size: 1252 bytes --]
--- linux-2.6.0-test7/arch/ia64/ia32/sys_ia32.c 2003-10-10 20:45:27.283410352 +0800
+++ linux-2.6.0-test7/arch/ia64/ia32/sys_ia32.c.new 2003-10-10 21:06:24.715035573 +0800
@@ -2486,11 +2486,14 @@
putstat64 (struct stat64 *ubuf, struct kstat *kbuf)
{
int err;
+ u64 hdev;
if (clear_user(ubuf, sizeof(*ubuf)))
return -EFAULT;
- err = __put_user(huge_encode_dev(kbuf->dev), &ubuf->st_dev);
+ hdev = huge_encode_dev(kbuf->dev);
+ err = __put_user(hdev, (u32*)&ubuf->st_dev);
+ err |= __put_user(hdev >> 32, ((u32*)&ubuf->st_dev) + 1);
err |= __put_user(kbuf->ino, &ubuf->__st_ino);
err |= __put_user(kbuf->ino, &ubuf->st_ino_lo);
err |= __put_user(kbuf->ino >> 32, &ubuf->st_ino_hi);
@@ -2498,7 +2501,9 @@
err |= __put_user(kbuf->nlink, &ubuf->st_nlink);
err |= __put_user(kbuf->uid, &ubuf->st_uid);
err |= __put_user(kbuf->gid, &ubuf->st_gid);
- err |= __put_user(huge_encode_dev(kbuf->rdev), &ubuf->st_rdev);
+ hdev = huge_encode_dev(kbuf->rdev);
+ err = __put_user(hdev, (u32*)&ubuf->st_rdev);
+ err |= __put_user(hdev >> 32, ((u32*)&ubuf->st_rdev) + 1);
err |= __put_user(kbuf->size, &ubuf->st_size_lo);
err |= __put_user((kbuf->size >> 32), &ubuf->st_size_hi);
err |= __put_user(kbuf->atime.tv_sec, &ubuf->st_atime);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-10-10 18:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-10 18:44 [PATCH] Fix unaligned faults in putstat64 Arun Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox