public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <adsharma@unix-os.sc.intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: IA-32 support patch: fcntl64 calls are broken
Date: Tue, 08 Jul 2003 18:57:21 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105769069703392@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105649509512709@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

Arun Sharma wrote:
> 
> Currently, sys32_fcntl64() is broken, because it passes F_*64 commands 
> to sys_fcntl(), which it doesn't understand. The F_XXX64 commands need 
> to be converted to F_XXX before calling sys_fcntl().
> 
> We also eliminated a copy, because the 32 bit struct flock64 and the 64 
> bit struct flock seem to be identical.
> 

Turns out that the structures are not identical (even though the data types of all the members have the same size) due to alignment issues. So the copy can not be eliminated.

> This patch is relevant only to 2.4, as it has already been taken care of 
> in 2.5.

A new patch is attached.

	-Arun

[-- Attachment #2: fcntl.29.txt --]
[-- Type: text/plain, Size: 594 bytes --]

--- linux/arch/ia64/ia32/sys_ia32.c-	Tue Jun 24 15:43:39 2003
+++ linux/arch/ia64/ia32/sys_ia32.c	Tue Jul  1 14:09:27 2003
@@ -3622,9 +3622,11 @@
 			return -EFAULT;
 		old_fs = get_fs();
 		set_fs(KERNEL_DS);
-		ret = sys_fcntl(fd, cmd, (unsigned long) &f);
+                ret = sys_fcntl(fd, (cmd == F_GETLK64) ? F_GETLK :
+                        ((cmd == F_SETLK64) ? F_SETLK : F_SETLKW),
+                        (unsigned long) &f);
 		set_fs(old_fs);
-		if (cmd == F_GETLK && ia32_put_flock(&f, arg))
+		if (cmd == F_GETLK64 && ia32_put_flock(&f, arg))
 			return -EFAULT;
 		break;
 

  parent reply	other threads:[~2003-07-08 18:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-24 22:51 IA-32 support patch: fcntl64 calls are broken Arun Sharma
2003-06-25 16:53 ` Bjorn Helgaas
2003-06-25 18:18 ` Arun Sharma
2003-06-25 21:06 ` Bjorn Helgaas
2003-06-26  1:27 ` Stephen Rothwell
2003-06-26  5:02 ` Bjorn Helgaas
2003-07-08 18:57 ` Arun Sharma [this message]
2003-07-08 19:16 ` Matthew Wilcox
2003-07-08 21:51 ` Arun Sharma
2003-07-15 19:26 ` Bjorn Helgaas

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=marc-linux-ia64-105769069703392@msgid-missing \
    --to=adsharma@unix-os.sc.intel.com \
    --cc=linux-ia64@vger.kernel.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