linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Meyer <thomas@m3y3r.de>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org
Subject: [PATCH 3/3] truncate()/ftruncate() fix length argument on ia32 emulation.
Date: Sat, 17 Sep 2011 20:01:17 +0200	[thread overview]
Message-ID: <1316282477.5814.19.camel@localhost.localdomain> (raw)

move signed-extended int to long, because of signed test.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
 arch/x86/ia32/ia32entry.S |    4 ++--
 fs/compat.c               |   10 ++++++++++
 include/linux/compat.h    |    2 ++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 30f4116..074b9d3 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -595,8 +595,8 @@ ia32_sys_call_table:
 	.quad compat_sys_old_readdir
 	.quad sys32_mmap		/* 90 */
 	.quad sys_munmap
-	.quad sys_truncate
-	.quad sys_ftruncate
+	.quad compat_sys_truncate
+	.quad compat_sys_ftruncate
 	.quad sys_fchmod
 	.quad sys_fchown16		/* 95 */
 	.quad sys_getpriority
diff --git a/fs/compat.c b/fs/compat.c
index 232675e..315ea2d 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1814,3 +1814,13 @@ compat_sys_open_by_handle_at(int mountdirfd,
 	return do_handle_open(mountdirfd, handle, flags);
 }
 #endif
+
+asmlinkage long compat_sys_truncate(const char __user *path, int length)
+{
+	return sys_truncate(path, length);
+}
+
+asmlinkage long compat_sys_ftruncate(unsigned int fd, int length)
+{
+	return sys_ftruncate(fd, length);
+}
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3bfb30a..7a3b0e7 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -544,6 +544,8 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
 			const struct compat_timespec __user *u_abs_timeout);
 asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
 asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
+asmlinkage long compat_sys_truncate(const char __user *path, int length);
+asmlinkage long compat_sys_ftruncate(unsigned int fd, int length);
 
 extern ssize_t compat_rw_copy_check_uvector(int type,
 		const struct compat_iovec __user *uvector,
-- 
1.7.6

             reply	other threads:[~2011-09-18  8:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 18:01 Thomas Meyer [this message]
2011-09-18 15:26 ` [PATCH 3/3] truncate()/ftruncate() fix length argument on ia32 emulation Arnd Bergmann
2011-09-19 13:16 ` Heiko Carstens

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=1316282477.5814.19.camel@localhost.localdomain \
    --to=thomas@m3y3r.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).